@iota/wallet-standard 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/detect.d.ts +1 -5
  4. package/dist/cjs/detect.js +0 -4
  5. package/dist/cjs/detect.js.map +2 -2
  6. package/dist/cjs/features/index.d.ts +11 -10
  7. package/dist/cjs/features/index.js +3 -3
  8. package/dist/cjs/features/index.js.map +2 -2
  9. package/dist/cjs/features/iotaReportTransactionEffects.d.ts +22 -0
  10. package/dist/cjs/features/{iotaSignAndExecuteTransactionBlock.js → iotaReportTransactionEffects.js} +3 -3
  11. package/dist/cjs/features/iotaReportTransactionEffects.js.map +7 -0
  12. package/dist/cjs/features/iotaSignAndExecuteTransaction.d.ts +29 -0
  13. package/dist/cjs/features/iotaSignAndExecuteTransaction.js +17 -0
  14. package/dist/cjs/features/iotaSignAndExecuteTransaction.js.map +7 -0
  15. package/dist/cjs/features/iotaSignPersonalMessage.d.ts +2 -0
  16. package/dist/cjs/features/iotaSignPersonalMessage.js.map +1 -1
  17. package/dist/cjs/features/iotaSignTransaction.d.ts +34 -0
  18. package/dist/cjs/features/{iotaSignTransactionBlock.js → iotaSignTransaction.js} +3 -3
  19. package/dist/cjs/features/iotaSignTransaction.js.map +7 -0
  20. package/dist/cjs/index.d.ts +2 -1
  21. package/dist/cjs/index.js +10 -0
  22. package/dist/cjs/index.js.map +2 -2
  23. package/dist/cjs/types.d.ts +156 -0
  24. package/dist/cjs/{features/iotaSignMessage.js → types.js} +3 -3
  25. package/dist/cjs/types.js.map +7 -0
  26. package/dist/cjs/wallet.d.ts +7 -0
  27. package/dist/cjs/wallet.js +24 -0
  28. package/dist/cjs/wallet.js.map +2 -2
  29. package/dist/esm/detect.d.ts +1 -5
  30. package/dist/esm/detect.js +0 -4
  31. package/dist/esm/detect.js.map +2 -2
  32. package/dist/esm/features/index.d.ts +11 -10
  33. package/dist/esm/features/index.js +3 -3
  34. package/dist/esm/features/index.js.map +2 -2
  35. package/dist/esm/features/iotaReportTransactionEffects.d.ts +22 -0
  36. package/dist/esm/features/iotaReportTransactionEffects.js +1 -0
  37. package/dist/esm/features/iotaSignAndExecuteTransaction.d.ts +29 -0
  38. package/dist/esm/features/iotaSignAndExecuteTransaction.js +1 -0
  39. package/dist/esm/features/iotaSignPersonalMessage.d.ts +2 -0
  40. package/dist/esm/features/iotaSignTransaction.d.ts +34 -0
  41. package/dist/esm/features/iotaSignTransaction.js +1 -0
  42. package/dist/esm/index.d.ts +2 -1
  43. package/dist/esm/index.js +6 -0
  44. package/dist/esm/index.js.map +2 -2
  45. package/dist/esm/types.d.ts +156 -0
  46. package/dist/esm/types.js +1 -0
  47. package/dist/esm/types.js.map +7 -0
  48. package/dist/esm/wallet.d.ts +7 -0
  49. package/dist/esm/wallet.js +20 -0
  50. package/dist/esm/wallet.js.map +3 -3
  51. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  52. package/dist/tsconfig.tsbuildinfo +1 -1
  53. package/package.json +7 -5
  54. package/src/detect.ts +2 -11
  55. package/src/features/index.ts +20 -21
  56. package/src/features/iotaReportTransactionEffects.ts +31 -0
  57. package/src/features/iotaSignAndExecuteTransaction.ts +40 -0
  58. package/src/features/iotaSignPersonalMessage.ts +2 -0
  59. package/src/features/iotaSignTransaction.ts +44 -0
  60. package/src/index.ts +2 -1
  61. package/src/types.ts +173 -0
  62. package/src/wallet.ts +38 -0
  63. package/dist/cjs/features/iotaSignAndExecuteTransactionBlock.d.ts +0 -31
  64. package/dist/cjs/features/iotaSignAndExecuteTransactionBlock.js.map +0 -7
  65. package/dist/cjs/features/iotaSignMessage.d.ts +0 -38
  66. package/dist/cjs/features/iotaSignMessage.js.map +0 -7
  67. package/dist/cjs/features/iotaSignTransactionBlock.d.ts +0 -30
  68. package/dist/cjs/features/iotaSignTransactionBlock.js.map +0 -7
  69. package/dist/esm/features/iotaSignAndExecuteTransactionBlock.d.ts +0 -31
  70. package/dist/esm/features/iotaSignAndExecuteTransactionBlock.js +0 -1
  71. package/dist/esm/features/iotaSignMessage.d.ts +0 -38
  72. package/dist/esm/features/iotaSignMessage.js +0 -1
  73. package/dist/esm/features/iotaSignTransactionBlock.d.ts +0 -30
  74. package/dist/esm/features/iotaSignTransactionBlock.js +0 -1
  75. package/src/features/iotaSignAndExecuteTransactionBlock.ts +0 -46
  76. package/src/features/iotaSignMessage.ts +0 -47
  77. package/src/features/iotaSignTransactionBlock.ts +0 -41
  78. /package/dist/esm/features/{iotaSignAndExecuteTransactionBlock.js.map → iotaReportTransactionEffects.js.map} +0 -0
  79. /package/dist/esm/features/{iotaSignMessage.js.map → iotaSignAndExecuteTransaction.js.map} +0 -0
  80. /package/dist/esm/features/{iotaSignTransactionBlock.js.map → iotaSignTransaction.js.map} +0 -0
package/src/types.ts ADDED
@@ -0,0 +1,173 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // Modifications Copyright (c) 2024 IOTA Stiftung
3
+ // SPDX-License-Identifier: Apache-2.0
4
+
5
+ /** Contains data related to the gas payment for a Transaction */
6
+ export interface GasData {
7
+ /** The budget set for this transaction */
8
+ budget: string | number | null;
9
+ /** The gas price used for this transaction */
10
+ price: string | number | null;
11
+ /** The owner of the gas coins used to fund the transactions, this is either the sender or the gas sponsor */
12
+ owner: string | null;
13
+ /** The list of IOTA coins to fund the transaction */
14
+ payment: { objectId: string; version: string; digest: string }[] | null;
15
+ }
16
+
17
+ /**
18
+ * Represent the serialized state of a partially built Transaction
19
+ * This format is designed to support transactions that have not been fully build
20
+ * allowing most properties to be omitted or set to null. It also supports
21
+ * unresolved object references, unresolved pure values, and Transaction Intents.
22
+ */
23
+ export interface SerializedTransactionDataV2 {
24
+ version: 2;
25
+ /** The sender of the transaction */
26
+ sender: string | null | undefined;
27
+ /** The expiration of the transaction */
28
+ expiration: { Epoch: number } | { None: true } | null | undefined;
29
+ /** The gas data */
30
+ gasData: GasData;
31
+ /** The inputs to the transaction */
32
+ inputs: CallArg[];
33
+ /** The commands to execute */
34
+ commands: Command[];
35
+ /** Extra metadata for implementation specific use-cases */
36
+ extensions?: { [key: string]: unknown };
37
+ }
38
+
39
+ /**
40
+ * Represents an input to a Transaction, either as a fully resolved Object or Pure input
41
+ * or as an unresolved partial reference which needs to be resolved before the transaction
42
+ * can be serialized to bcs and executed.
43
+ */
44
+ export type CallArg =
45
+ | {
46
+ Object: ObjectArg;
47
+ }
48
+ | {
49
+ Pure: PureArg;
50
+ }
51
+ | {
52
+ UnresolvedPure: UnresolvedPureArg;
53
+ }
54
+ | {
55
+ UnresolvedObject: UnresolvedObjectArg;
56
+ };
57
+
58
+ export type ObjectArg =
59
+ | {
60
+ ImmOrOwnedObject: {
61
+ objectId: string;
62
+ version: string | number;
63
+ digest: string;
64
+ };
65
+ }
66
+ | {
67
+ SharedObject: {
68
+ objectId: string;
69
+ initialSharedVersion: string;
70
+ mutable: boolean;
71
+ };
72
+ }
73
+ | {
74
+ Receiving: {
75
+ objectId: string;
76
+ version: string | number;
77
+ digest: string;
78
+ };
79
+ };
80
+
81
+ export interface PureArg {
82
+ bytes: string;
83
+ }
84
+
85
+ /**
86
+ * Represents an un-serialized pure value.
87
+ * The correct bcs schema will need to be determined before this value can be serialized to bcs */
88
+ export interface UnresolvedPureArg {
89
+ value: unknown;
90
+ }
91
+
92
+ /**
93
+ * Represents an unresolved object reference. This allows objects to be referenced by only their ID.
94
+ * version and digest details may also be added to unresolved object references.
95
+ * To fully resolve a reference, the correct ObjectArg type needs to be determined based on the type of object,
96
+ * and how it used in the transaction (eg, is it used mutably if it's shared, and is it a receiving object if it's not shared)
97
+ */
98
+ export interface UnresolvedObjectArg {
99
+ objectId: string;
100
+ version?: string | null | undefined;
101
+ digest?: string | null | undefined;
102
+ initialSharedVersion?: string | null | undefined;
103
+ }
104
+
105
+ export type Argument =
106
+ | {
107
+ GasCoin: true;
108
+ }
109
+ | {
110
+ Input: number;
111
+ }
112
+ | {
113
+ Result: number;
114
+ }
115
+ | {
116
+ NestedResult: [number, number];
117
+ };
118
+
119
+ export type Command =
120
+ | {
121
+ MoveCall: {
122
+ package: string;
123
+ module: string;
124
+ function: string;
125
+ typeArguments: string[];
126
+ arguments: Argument[];
127
+ };
128
+ }
129
+ | {
130
+ TransferObjects: {
131
+ objects: Argument[];
132
+ address: Argument;
133
+ };
134
+ }
135
+ | {
136
+ SplitCoins: {
137
+ coin: Argument;
138
+ amounts: Argument[];
139
+ };
140
+ }
141
+ | {
142
+ MergeCoins: {
143
+ destination: Argument;
144
+ sources: Argument[];
145
+ };
146
+ }
147
+ | {
148
+ Publish: {
149
+ modules: string[];
150
+ dependencies: string[];
151
+ };
152
+ }
153
+ | {
154
+ MakeMoveVec: {
155
+ type: string | null;
156
+ elements: Argument[];
157
+ };
158
+ }
159
+ | {
160
+ Upgrade: {
161
+ modules: string[];
162
+ dependencies: string[];
163
+ package: string;
164
+ ticket: Argument;
165
+ };
166
+ }
167
+ | {
168
+ $Intent: {
169
+ name: string;
170
+ inputs: { [key: string]: Argument | Argument[] };
171
+ data: { [key: string]: unknown };
172
+ };
173
+ };
package/src/wallet.ts CHANGED
@@ -2,6 +2,14 @@
2
2
  // Modifications Copyright (c) 2024 IOTA Stiftung
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
 
5
+ import type { WalletWithFeatures } from '@wallet-standard/core';
6
+
7
+ import type {
8
+ IotaSignAndExecuteTransactionInput,
9
+ IotaSignTransactionInput,
10
+ IotaWalletFeatures,
11
+ } from './features/index.js';
12
+
5
13
  declare module '@wallet-standard/core' {
6
14
  export interface Wallet {
7
15
  /**
@@ -11,6 +19,36 @@ declare module '@wallet-standard/core' {
11
19
  */
12
20
  readonly id?: string;
13
21
  }
22
+
23
+ export interface StandardConnectOutput {
24
+ supportedIntents?: string[];
25
+ }
14
26
  }
15
27
 
16
28
  export type { Wallet } from '@wallet-standard/core';
29
+
30
+ export async function signAndExecuteTransaction(
31
+ wallet: WalletWithFeatures<Partial<IotaWalletFeatures>>,
32
+ input: IotaSignAndExecuteTransactionInput,
33
+ ) {
34
+ if (!wallet.features['iota:signAndExecuteTransaction']) {
35
+ throw new Error(
36
+ `Provided wallet (${wallet.name}) does not support the signAndExecuteTransaction feature.`,
37
+ );
38
+ }
39
+
40
+ return wallet.features['iota:signAndExecuteTransaction'].signAndExecuteTransaction(input);
41
+ }
42
+
43
+ export async function signTransaction(
44
+ wallet: WalletWithFeatures<Partial<IotaWalletFeatures>>,
45
+ input: IotaSignTransactionInput,
46
+ ) {
47
+ if (!wallet.features['iota:signTransaction']) {
48
+ throw new Error(
49
+ `Provided wallet (${wallet.name}) does not support the signTransaction feature.`,
50
+ );
51
+ }
52
+
53
+ return wallet.features['iota:signTransaction'].signTransaction(input);
54
+ }
@@ -1,31 +0,0 @@
1
- import type { ExecuteTransactionRequestType, IotaTransactionBlockResponse, IotaTransactionBlockResponseOptions } from '@iota/iota-sdk/client';
2
- import type { IotaSignTransactionBlockInput } from './iotaSignTransactionBlock.js';
3
- /** The latest API version of the signAndExecuteTransactionBlock API. */
4
- export type IotaSignAndExecuteTransactionBlockVersion = '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 IotaSignAndExecuteTransactionBlockFeature = {
11
- /** Namespace for the feature. */
12
- 'iota:signAndExecuteTransactionBlock': {
13
- /** Version of the feature API. */
14
- version: IotaSignAndExecuteTransactionBlockVersion;
15
- signAndExecuteTransactionBlock: IotaSignAndExecuteTransactionBlockMethod;
16
- };
17
- };
18
- export type IotaSignAndExecuteTransactionBlockMethod = (input: IotaSignAndExecuteTransactionBlockInput) => Promise<IotaSignAndExecuteTransactionBlockOutput>;
19
- /** Input for signing and sending transactions. */
20
- export interface IotaSignAndExecuteTransactionBlockInput extends IotaSignTransactionBlockInput {
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?: IotaTransactionBlockResponseOptions;
28
- }
29
- /** Output of signing and sending transactions. */
30
- export interface IotaSignAndExecuteTransactionBlockOutput extends IotaTransactionBlockResponse {
31
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/features/iotaSignAndExecuteTransactionBlock.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// Modifications Copyright (c) 2024 IOTA Stiftung\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n ExecuteTransactionRequestType,\n IotaTransactionBlockResponse,\n IotaTransactionBlockResponseOptions,\n} from '@iota/iota-sdk/client';\n\nimport type { IotaSignTransactionBlockInput } from './iotaSignTransactionBlock.js';\n\n/** The latest API version of the signAndExecuteTransactionBlock API. */\nexport type IotaSignAndExecuteTransactionBlockVersion = '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 IotaSignAndExecuteTransactionBlockFeature = {\n /** Namespace for the feature. */\n 'iota:signAndExecuteTransactionBlock': {\n /** Version of the feature API. */\n version: IotaSignAndExecuteTransactionBlockVersion;\n signAndExecuteTransactionBlock: IotaSignAndExecuteTransactionBlockMethod;\n };\n};\n\nexport type IotaSignAndExecuteTransactionBlockMethod = (\n input: IotaSignAndExecuteTransactionBlockInput,\n) => Promise<IotaSignAndExecuteTransactionBlockOutput>;\n\n/** Input for signing and sending transactions. */\nexport interface IotaSignAndExecuteTransactionBlockInput extends IotaSignTransactionBlockInput {\n /**\n * `WaitForEffectsCert` or `WaitForLocalExecution`, see details in `ExecuteTransactionRequestType`.\n * Defaults to `WaitForLocalExecution` if options.showEffects or options.showEvents is true\n */\n requestType?: ExecuteTransactionRequestType;\n /** specify which fields to return (e.g., transaction, effects, events, etc). By default, only the transaction digest will be returned. */\n options?: IotaTransactionBlockResponseOptions;\n}\n\n/** Output of signing and sending transactions. */\nexport interface IotaSignAndExecuteTransactionBlockOutput extends IotaTransactionBlockResponse {}\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,38 +0,0 @@
1
- import type { WalletAccount } from '@wallet-standard/core';
2
- /**
3
- * The latest API version of the signMessage API.
4
- * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature
5
- */
6
- export type IotaSignMessageVersion = '1.0.0';
7
- /**
8
- * A Wallet Standard feature for signing a personal message, and returning the
9
- * message bytes that were signed, and message signature.
10
- *
11
- * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature
12
- */
13
- export type IotaSignMessageFeature = {
14
- /** Namespace for the feature. */
15
- 'iota:signMessage': {
16
- /** Version of the feature API. */
17
- version: IotaSignMessageVersion;
18
- signMessage: IotaSignMessageMethod;
19
- };
20
- };
21
- /** @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature */
22
- export type IotaSignMessageMethod = (input: IotaSignMessageInput) => Promise<IotaSignMessageOutput>;
23
- /**
24
- * Input for signing messages.
25
- * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature
26
- */
27
- export interface IotaSignMessageInput {
28
- message: Uint8Array;
29
- account: WalletAccount;
30
- }
31
- /**
32
- * Output of signing messages.
33
- * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature
34
- */
35
- export interface IotaSignMessageOutput {
36
- messageBytes: string;
37
- signature: string;
38
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/features/iotaSignMessage.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// Modifications Copyright (c) 2024 IOTA Stiftung\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 `iota:signPersonalMessage` feature\n */\nexport type IotaSignMessageVersion = '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 `iota:signPersonalMessage` feature\n */\nexport type IotaSignMessageFeature = {\n /** Namespace for the feature. */\n 'iota:signMessage': {\n /** Version of the feature API. */\n version: IotaSignMessageVersion;\n signMessage: IotaSignMessageMethod;\n };\n};\n\n/** @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature */\nexport type IotaSignMessageMethod = (input: IotaSignMessageInput) => Promise<IotaSignMessageOutput>;\n\n/**\n * Input for signing messages.\n * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature\n */\nexport interface IotaSignMessageInput {\n message: Uint8Array;\n account: 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 `iota:signPersonalMessage` feature\n */\nexport interface IotaSignMessageOutput {\n messageBytes: string;\n signature: string;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,30 +0,0 @@
1
- import type { TransactionBlock } from '@iota/iota-sdk/transactions';
2
- import type { IdentifierString, WalletAccount } from '@wallet-standard/core';
3
- /** The latest API version of the signTransactionBlock API. */
4
- export type IotaSignTransactionBlockVersion = '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 IotaSignTransactionBlockFeature = {
10
- /** Namespace for the feature. */
11
- 'iota:signTransactionBlock': {
12
- /** Version of the feature API. */
13
- version: IotaSignTransactionBlockVersion;
14
- signTransactionBlock: IotaSignTransactionBlockMethod;
15
- };
16
- };
17
- export type IotaSignTransactionBlockMethod = (input: IotaSignTransactionBlockInput) => Promise<IotaSignTransactionBlockOutput>;
18
- /** Input for signing transactions. */
19
- export interface IotaSignTransactionBlockInput {
20
- transactionBlock: TransactionBlock;
21
- account: WalletAccount;
22
- chain: IdentifierString;
23
- }
24
- /** Output of signing transactions. */
25
- export interface IotaSignTransactionBlockOutput extends SignedTransactionBlock {
26
- }
27
- export interface SignedTransactionBlock {
28
- transactionBlockBytes: string;
29
- signature: string;
30
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/features/iotaSignTransactionBlock.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// Modifications Copyright (c) 2024 IOTA Stiftung\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TransactionBlock } from '@iota/iota-sdk/transactions';\nimport type { IdentifierString, WalletAccount } from '@wallet-standard/core';\n\n/** The latest API version of the signTransactionBlock API. */\nexport type IotaSignTransactionBlockVersion = '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 IotaSignTransactionBlockFeature = {\n /** Namespace for the feature. */\n 'iota:signTransactionBlock': {\n /** Version of the feature API. */\n version: IotaSignTransactionBlockVersion;\n signTransactionBlock: IotaSignTransactionBlockMethod;\n };\n};\n\nexport type IotaSignTransactionBlockMethod = (\n input: IotaSignTransactionBlockInput,\n) => Promise<IotaSignTransactionBlockOutput>;\n\n/** Input for signing transactions. */\nexport interface IotaSignTransactionBlockInput {\n transactionBlock: TransactionBlock;\n account: WalletAccount;\n chain: IdentifierString;\n}\n\n/** Output of signing transactions. */\nexport interface IotaSignTransactionBlockOutput extends SignedTransactionBlock {}\n\nexport interface SignedTransactionBlock {\n transactionBlockBytes: string;\n signature: string;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,31 +0,0 @@
1
- import type { ExecuteTransactionRequestType, IotaTransactionBlockResponse, IotaTransactionBlockResponseOptions } from '@iota/iota-sdk/client';
2
- import type { IotaSignTransactionBlockInput } from './iotaSignTransactionBlock.js';
3
- /** The latest API version of the signAndExecuteTransactionBlock API. */
4
- export type IotaSignAndExecuteTransactionBlockVersion = '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 IotaSignAndExecuteTransactionBlockFeature = {
11
- /** Namespace for the feature. */
12
- 'iota:signAndExecuteTransactionBlock': {
13
- /** Version of the feature API. */
14
- version: IotaSignAndExecuteTransactionBlockVersion;
15
- signAndExecuteTransactionBlock: IotaSignAndExecuteTransactionBlockMethod;
16
- };
17
- };
18
- export type IotaSignAndExecuteTransactionBlockMethod = (input: IotaSignAndExecuteTransactionBlockInput) => Promise<IotaSignAndExecuteTransactionBlockOutput>;
19
- /** Input for signing and sending transactions. */
20
- export interface IotaSignAndExecuteTransactionBlockInput extends IotaSignTransactionBlockInput {
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?: IotaTransactionBlockResponseOptions;
28
- }
29
- /** Output of signing and sending transactions. */
30
- export interface IotaSignAndExecuteTransactionBlockOutput extends IotaTransactionBlockResponse {
31
- }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=iotaSignAndExecuteTransactionBlock.js.map
@@ -1,38 +0,0 @@
1
- import type { WalletAccount } from '@wallet-standard/core';
2
- /**
3
- * The latest API version of the signMessage API.
4
- * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature
5
- */
6
- export type IotaSignMessageVersion = '1.0.0';
7
- /**
8
- * A Wallet Standard feature for signing a personal message, and returning the
9
- * message bytes that were signed, and message signature.
10
- *
11
- * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature
12
- */
13
- export type IotaSignMessageFeature = {
14
- /** Namespace for the feature. */
15
- 'iota:signMessage': {
16
- /** Version of the feature API. */
17
- version: IotaSignMessageVersion;
18
- signMessage: IotaSignMessageMethod;
19
- };
20
- };
21
- /** @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature */
22
- export type IotaSignMessageMethod = (input: IotaSignMessageInput) => Promise<IotaSignMessageOutput>;
23
- /**
24
- * Input for signing messages.
25
- * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature
26
- */
27
- export interface IotaSignMessageInput {
28
- message: Uint8Array;
29
- account: WalletAccount;
30
- }
31
- /**
32
- * Output of signing messages.
33
- * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature
34
- */
35
- export interface IotaSignMessageOutput {
36
- messageBytes: string;
37
- signature: string;
38
- }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=iotaSignMessage.js.map
@@ -1,30 +0,0 @@
1
- import type { TransactionBlock } from '@iota/iota-sdk/transactions';
2
- import type { IdentifierString, WalletAccount } from '@wallet-standard/core';
3
- /** The latest API version of the signTransactionBlock API. */
4
- export type IotaSignTransactionBlockVersion = '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 IotaSignTransactionBlockFeature = {
10
- /** Namespace for the feature. */
11
- 'iota:signTransactionBlock': {
12
- /** Version of the feature API. */
13
- version: IotaSignTransactionBlockVersion;
14
- signTransactionBlock: IotaSignTransactionBlockMethod;
15
- };
16
- };
17
- export type IotaSignTransactionBlockMethod = (input: IotaSignTransactionBlockInput) => Promise<IotaSignTransactionBlockOutput>;
18
- /** Input for signing transactions. */
19
- export interface IotaSignTransactionBlockInput {
20
- transactionBlock: TransactionBlock;
21
- account: WalletAccount;
22
- chain: IdentifierString;
23
- }
24
- /** Output of signing transactions. */
25
- export interface IotaSignTransactionBlockOutput extends SignedTransactionBlock {
26
- }
27
- export interface SignedTransactionBlock {
28
- transactionBlockBytes: string;
29
- signature: string;
30
- }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=iotaSignTransactionBlock.js.map
@@ -1,46 +0,0 @@
1
- // Copyright (c) Mysten Labs, Inc.
2
- // Modifications Copyright (c) 2024 IOTA Stiftung
3
- // SPDX-License-Identifier: Apache-2.0
4
-
5
- import type {
6
- ExecuteTransactionRequestType,
7
- IotaTransactionBlockResponse,
8
- IotaTransactionBlockResponseOptions,
9
- } from '@iota/iota-sdk/client';
10
-
11
- import type { IotaSignTransactionBlockInput } from './iotaSignTransactionBlock.js';
12
-
13
- /** The latest API version of the signAndExecuteTransactionBlock API. */
14
- export type IotaSignAndExecuteTransactionBlockVersion = '1.0.0';
15
-
16
- /**
17
- * A Wallet Standard feature for signing a transaction, and submitting it to the
18
- * network. The wallet is expected to submit the transaction to the network via RPC,
19
- * and return the transaction response.
20
- */
21
- export type IotaSignAndExecuteTransactionBlockFeature = {
22
- /** Namespace for the feature. */
23
- 'iota:signAndExecuteTransactionBlock': {
24
- /** Version of the feature API. */
25
- version: IotaSignAndExecuteTransactionBlockVersion;
26
- signAndExecuteTransactionBlock: IotaSignAndExecuteTransactionBlockMethod;
27
- };
28
- };
29
-
30
- export type IotaSignAndExecuteTransactionBlockMethod = (
31
- input: IotaSignAndExecuteTransactionBlockInput,
32
- ) => Promise<IotaSignAndExecuteTransactionBlockOutput>;
33
-
34
- /** Input for signing and sending transactions. */
35
- export interface IotaSignAndExecuteTransactionBlockInput extends IotaSignTransactionBlockInput {
36
- /**
37
- * `WaitForEffectsCert` or `WaitForLocalExecution`, see details in `ExecuteTransactionRequestType`.
38
- * Defaults to `WaitForLocalExecution` if options.showEffects or options.showEvents is true
39
- */
40
- requestType?: ExecuteTransactionRequestType;
41
- /** specify which fields to return (e.g., transaction, effects, events, etc). By default, only the transaction digest will be returned. */
42
- options?: IotaTransactionBlockResponseOptions;
43
- }
44
-
45
- /** Output of signing and sending transactions. */
46
- export interface IotaSignAndExecuteTransactionBlockOutput extends IotaTransactionBlockResponse {}
@@ -1,47 +0,0 @@
1
- // Copyright (c) Mysten Labs, Inc.
2
- // Modifications Copyright (c) 2024 IOTA Stiftung
3
- // SPDX-License-Identifier: Apache-2.0
4
-
5
- import type { WalletAccount } from '@wallet-standard/core';
6
-
7
- /**
8
- * The latest API version of the signMessage API.
9
- * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature
10
- */
11
- export type IotaSignMessageVersion = '1.0.0';
12
-
13
- /**
14
- * A Wallet Standard feature for signing a personal message, and returning the
15
- * message bytes that were signed, and message signature.
16
- *
17
- * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature
18
- */
19
- export type IotaSignMessageFeature = {
20
- /** Namespace for the feature. */
21
- 'iota:signMessage': {
22
- /** Version of the feature API. */
23
- version: IotaSignMessageVersion;
24
- signMessage: IotaSignMessageMethod;
25
- };
26
- };
27
-
28
- /** @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature */
29
- export type IotaSignMessageMethod = (input: IotaSignMessageInput) => Promise<IotaSignMessageOutput>;
30
-
31
- /**
32
- * Input for signing messages.
33
- * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature
34
- */
35
- export interface IotaSignMessageInput {
36
- message: Uint8Array;
37
- account: WalletAccount;
38
- }
39
-
40
- /**
41
- * Output of signing messages.
42
- * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `iota:signPersonalMessage` feature
43
- */
44
- export interface IotaSignMessageOutput {
45
- messageBytes: string;
46
- signature: string;
47
- }
@@ -1,41 +0,0 @@
1
- // Copyright (c) Mysten Labs, Inc.
2
- // Modifications Copyright (c) 2024 IOTA Stiftung
3
- // SPDX-License-Identifier: Apache-2.0
4
-
5
- import type { TransactionBlock } from '@iota/iota-sdk/transactions';
6
- import type { IdentifierString, WalletAccount } from '@wallet-standard/core';
7
-
8
- /** The latest API version of the signTransactionBlock API. */
9
- export type IotaSignTransactionBlockVersion = '1.0.0';
10
-
11
- /**
12
- * A Wallet Standard feature for signing a transaction, and returning the
13
- * serialized transaction and transaction signature.
14
- */
15
- export type IotaSignTransactionBlockFeature = {
16
- /** Namespace for the feature. */
17
- 'iota:signTransactionBlock': {
18
- /** Version of the feature API. */
19
- version: IotaSignTransactionBlockVersion;
20
- signTransactionBlock: IotaSignTransactionBlockMethod;
21
- };
22
- };
23
-
24
- export type IotaSignTransactionBlockMethod = (
25
- input: IotaSignTransactionBlockInput,
26
- ) => Promise<IotaSignTransactionBlockOutput>;
27
-
28
- /** Input for signing transactions. */
29
- export interface IotaSignTransactionBlockInput {
30
- transactionBlock: TransactionBlock;
31
- account: WalletAccount;
32
- chain: IdentifierString;
33
- }
34
-
35
- /** Output of signing transactions. */
36
- export interface IotaSignTransactionBlockOutput extends SignedTransactionBlock {}
37
-
38
- export interface SignedTransactionBlock {
39
- transactionBlockBytes: string;
40
- signature: string;
41
- }