@iota/wallet-standard 0.1.3 → 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 +12 -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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @iota/wallet-standard
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6eabd18: Changes for compatibility with the node, simplification of exposed APIs and general
8
+ improvements.
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies [6eabd18]
13
+ - @iota/iota-sdk@0.3.0
14
+
3
15
  ## 0.1.3
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -3,4 +3,4 @@
3
3
  A suite of standard utilities for implementing wallets and libraries based on the
4
4
  [Wallet Standard](https://github.com/wallet-standard/wallet-standard/).
5
5
 
6
- **Documentation:** https://docs.iota.io/standards/wallet-standard
6
+ **Documentation:** https://wiki.iota.org/standards/wallet-standard
@@ -1,7 +1,3 @@
1
1
  import type { Wallet, WalletWithFeatures } from '@wallet-standard/core';
2
- import type { MinimallyRequiredFeatures, WalletWithIotaFeatures } from './features/index.js';
3
- /** @deprecated Use isWalletWithRequiredFeatureSet instead since it provides more accurate typing! */
4
- export declare function isWalletWithIotaFeatures(wallet: Wallet,
5
- /** Extra features that are required to be present, in addition to the expected feature set. */
6
- features?: string[]): wallet is WalletWithIotaFeatures;
2
+ import type { MinimallyRequiredFeatures } from './features/index.js';
7
3
  export declare function isWalletWithRequiredFeatureSet<AdditionalFeatures extends Wallet['features']>(wallet: Wallet, additionalFeatures?: (keyof AdditionalFeatures)[]): wallet is WalletWithFeatures<MinimallyRequiredFeatures & AdditionalFeatures>;
@@ -18,7 +18,6 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var detect_exports = {};
20
20
  __export(detect_exports, {
21
- isWalletWithIotaFeatures: () => isWalletWithIotaFeatures,
22
21
  isWalletWithRequiredFeatureSet: () => isWalletWithRequiredFeatureSet
23
22
  });
24
23
  module.exports = __toCommonJS(detect_exports);
@@ -26,9 +25,6 @@ const REQUIRED_FEATURES = [
26
25
  "standard:connect",
27
26
  "standard:events"
28
27
  ];
29
- function isWalletWithIotaFeatures(wallet, features = []) {
30
- return [...REQUIRED_FEATURES, ...features].every((feature) => feature in wallet.features);
31
- }
32
28
  function isWalletWithRequiredFeatureSet(wallet, additionalFeatures = []) {
33
29
  return [...REQUIRED_FEATURES, ...additionalFeatures].every(
34
30
  (feature) => feature in wallet.features
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/detect.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 { Wallet, WalletWithFeatures } from '@wallet-standard/core';\n\nimport type { MinimallyRequiredFeatures, WalletWithIotaFeatures } from './features/index.js';\n\n// These features are absolutely required for wallets to function in the Iota ecosystem.\n// Eventually, as wallets have more consistent support of features, we may want to extend this list.\nconst REQUIRED_FEATURES: (keyof MinimallyRequiredFeatures)[] = [\n 'standard:connect',\n 'standard:events',\n];\n\n/** @deprecated Use isWalletWithRequiredFeatureSet instead since it provides more accurate typing! */\nexport function isWalletWithIotaFeatures(\n wallet: Wallet,\n /** Extra features that are required to be present, in addition to the expected feature set. */\n features: string[] = [],\n): wallet is WalletWithIotaFeatures {\n return [...REQUIRED_FEATURES, ...features].every((feature) => feature in wallet.features);\n}\n\nexport function isWalletWithRequiredFeatureSet<AdditionalFeatures extends Wallet['features']>(\n wallet: Wallet,\n additionalFeatures: (keyof AdditionalFeatures)[] = [],\n): wallet is WalletWithFeatures<MinimallyRequiredFeatures & AdditionalFeatures> {\n return [...REQUIRED_FEATURES, ...additionalFeatures].every(\n (feature) => feature in wallet.features,\n );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,MAAM,oBAAyD;AAAA,EAC3D;AAAA,EACA;AACJ;AAGO,SAAS,yBACZ,QAEA,WAAqB,CAAC,GACU;AAChC,SAAO,CAAC,GAAG,mBAAmB,GAAG,QAAQ,EAAE,MAAM,CAAC,YAAY,WAAW,OAAO,QAAQ;AAC5F;AAEO,SAAS,+BACZ,QACA,qBAAmD,CAAC,GACwB;AAC5E,SAAO,CAAC,GAAG,mBAAmB,GAAG,kBAAkB,EAAE;AAAA,IACjD,CAAC,YAAY,WAAW,OAAO;AAAA,EACnC;AACJ;",
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// Modifications Copyright (c) 2024 IOTA Stiftung\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Wallet, WalletWithFeatures } from '@wallet-standard/core';\n\nimport type { MinimallyRequiredFeatures } from './features/index.js';\n\n// These features are absolutely required for wallets to function in the IOTA ecosystem.\n// Eventually, as wallets have more consistent support of features, we may want to extend this list.\nconst REQUIRED_FEATURES: (keyof MinimallyRequiredFeatures)[] = [\n 'standard:connect',\n 'standard:events',\n];\n\nexport function isWalletWithRequiredFeatureSet<AdditionalFeatures extends Wallet['features']>(\n wallet: Wallet,\n additionalFeatures: (keyof AdditionalFeatures)[] = [],\n): wallet is WalletWithFeatures<MinimallyRequiredFeatures & AdditionalFeatures> {\n return [...REQUIRED_FEATURES, ...additionalFeatures].every(\n (feature) => feature in wallet.features,\n );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,MAAM,oBAAyD;AAAA,EAC3D;AAAA,EACA;AACJ;AAEO,SAAS,+BACZ,QACA,qBAAmD,CAAC,GACwB;AAC5E,SAAO,CAAC,GAAG,mBAAmB,GAAG,kBAAkB,EAAE;AAAA,IACjD,CAAC,YAAY,WAAW,OAAO;AAAA,EACnC;AACJ;",
6
6
  "names": []
7
7
  }
@@ -1,19 +1,20 @@
1
1
  import type { IdentifierRecord, StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature, WalletWithFeatures } from '@wallet-standard/core';
2
- import type { IotaSignAndExecuteTransactionBlockFeature } from './iotaSignAndExecuteTransactionBlock.js';
3
- import type { IotaSignMessageFeature } from './iotaSignMessage.js';
2
+ import type { IotaReportTransactionEffectsFeature } from './iotaReportTransactionEffects.js';
3
+ import type { IotaSignAndExecuteTransactionFeature } from './iotaSignAndExecuteTransaction.js';
4
4
  import type { IotaSignPersonalMessageFeature } from './iotaSignPersonalMessage.js';
5
- import type { IotaSignTransactionBlockFeature } from './iotaSignTransactionBlock.js';
5
+ import type { IotaSignTransactionFeature } from './iotaSignTransaction.js';
6
6
  /**
7
- * Wallet Standard features that are unique to Iota, and that all Iota wallets are expected to implement.
7
+ * Wallet Standard features that are unique to IOTA, and that all IOTA wallets are expected to implement.
8
8
  */
9
- export type IotaFeatures = IotaSignTransactionBlockFeature & IotaSignAndExecuteTransactionBlockFeature & IotaSignPersonalMessageFeature & Partial<IotaSignMessageFeature>;
10
- export type WalletWithIotaFeatures = WalletWithFeatures<StandardConnectFeature & StandardEventsFeature & IotaFeatures & Partial<StandardDisconnectFeature>>;
9
+ export type IotaFeatures = IotaSignPersonalMessageFeature & IotaSignAndExecuteTransactionFeature & IotaSignTransactionFeature & Partial<IotaReportTransactionEffectsFeature>;
10
+ export type IotaWalletFeatures = StandardConnectFeature & StandardEventsFeature & IotaFeatures & Partial<StandardDisconnectFeature>;
11
+ export type WalletWithIotaFeatures = WalletWithFeatures<IotaWalletFeatures>;
11
12
  /**
12
- * Represents a wallet with the absolute minimum feature set required to function in the Iota ecosystem.
13
+ * Represents a wallet with the absolute minimum feature set required to function in the IOTA ecosystem.
13
14
  */
14
15
  export type WalletWithRequiredFeatures = WalletWithFeatures<MinimallyRequiredFeatures & Partial<IotaFeatures> & Partial<StandardDisconnectFeature> & IdentifierRecord<unknown>>;
15
16
  export type MinimallyRequiredFeatures = StandardConnectFeature & StandardEventsFeature;
16
- export * from './iotaSignMessage.js';
17
- export * from './iotaSignTransactionBlock.js';
18
- export * from './iotaSignAndExecuteTransactionBlock.js';
17
+ export * from './iotaSignTransaction.js';
18
+ export * from './iotaSignAndExecuteTransaction.js';
19
19
  export * from './iotaSignPersonalMessage.js';
20
+ export * from './iotaReportTransactionEffects.js';
@@ -15,8 +15,8 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
15
15
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
16
  var features_exports = {};
17
17
  module.exports = __toCommonJS(features_exports);
18
- __reExport(features_exports, require("./iotaSignMessage.js"), module.exports);
19
- __reExport(features_exports, require("./iotaSignTransactionBlock.js"), module.exports);
20
- __reExport(features_exports, require("./iotaSignAndExecuteTransactionBlock.js"), module.exports);
18
+ __reExport(features_exports, require("./iotaSignTransaction.js"), module.exports);
19
+ __reExport(features_exports, require("./iotaSignAndExecuteTransaction.js"), module.exports);
21
20
  __reExport(features_exports, require("./iotaSignPersonalMessage.js"), module.exports);
21
+ __reExport(features_exports, require("./iotaReportTransactionEffects.js"), module.exports);
22
22
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/features/index.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 IdentifierRecord,\n StandardConnectFeature,\n StandardDisconnectFeature,\n StandardEventsFeature,\n WalletWithFeatures,\n} from '@wallet-standard/core';\n\nimport type { IotaSignAndExecuteTransactionBlockFeature } from './iotaSignAndExecuteTransactionBlock.js';\nimport type { IotaSignMessageFeature } from './iotaSignMessage.js';\nimport type { IotaSignPersonalMessageFeature } from './iotaSignPersonalMessage.js';\nimport type { IotaSignTransactionBlockFeature } from './iotaSignTransactionBlock.js';\n\n/**\n * Wallet Standard features that are unique to Iota, and that all Iota wallets are expected to implement.\n */\nexport type IotaFeatures = IotaSignTransactionBlockFeature &\n IotaSignAndExecuteTransactionBlockFeature &\n IotaSignPersonalMessageFeature &\n // This deprecated feature should be removed once wallets update to the new method:\n Partial<IotaSignMessageFeature>;\n\nexport type WalletWithIotaFeatures = WalletWithFeatures<\n StandardConnectFeature &\n StandardEventsFeature &\n IotaFeatures &\n // Disconnect is an optional feature:\n Partial<StandardDisconnectFeature>\n>;\n\n/**\n * Represents a wallet with the absolute minimum feature set required to function in the Iota ecosystem.\n */\nexport type WalletWithRequiredFeatures = WalletWithFeatures<\n MinimallyRequiredFeatures &\n Partial<IotaFeatures> &\n Partial<StandardDisconnectFeature> &\n IdentifierRecord<unknown>\n>;\n\nexport type MinimallyRequiredFeatures = StandardConnectFeature & StandardEventsFeature;\n\nexport * from './iotaSignMessage.js';\nexport * from './iotaSignTransactionBlock.js';\nexport * from './iotaSignAndExecuteTransactionBlock.js';\nexport * from './iotaSignPersonalMessage.js';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AA8CA,6BAAc,iCA9Cd;AA+CA,6BAAc,0CA/Cd;AAgDA,6BAAc,oDAhDd;AAiDA,6BAAc,yCAjDd;",
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 IdentifierRecord,\n StandardConnectFeature,\n StandardDisconnectFeature,\n StandardEventsFeature,\n WalletWithFeatures,\n} from '@wallet-standard/core';\n\nimport type { IotaReportTransactionEffectsFeature } from './iotaReportTransactionEffects.js';\nimport type { IotaSignAndExecuteTransactionFeature } from './iotaSignAndExecuteTransaction.js';\nimport type { IotaSignPersonalMessageFeature } from './iotaSignPersonalMessage.js';\nimport type { IotaSignTransactionFeature } from './iotaSignTransaction.js';\n\n/**\n * Wallet Standard features that are unique to IOTA, and that all IOTA wallets are expected to implement.\n */\nexport type IotaFeatures = IotaSignPersonalMessageFeature &\n IotaSignAndExecuteTransactionFeature &\n IotaSignTransactionFeature &\n Partial<IotaReportTransactionEffectsFeature>;\n\nexport type IotaWalletFeatures = StandardConnectFeature &\n StandardEventsFeature &\n IotaFeatures &\n // Disconnect is an optional feature:\n Partial<StandardDisconnectFeature>;\n\nexport type WalletWithIotaFeatures = WalletWithFeatures<IotaWalletFeatures>;\n\n/**\n * Represents a wallet with the absolute minimum feature set required to function in the IOTA ecosystem.\n */\nexport type WalletWithRequiredFeatures = WalletWithFeatures<\n MinimallyRequiredFeatures &\n Partial<IotaFeatures> &\n Partial<StandardDisconnectFeature> &\n IdentifierRecord<unknown>\n>;\n\nexport type MinimallyRequiredFeatures = StandardConnectFeature & StandardEventsFeature;\n\nexport * from './iotaSignTransaction.js';\nexport * from './iotaSignAndExecuteTransaction.js';\nexport * from './iotaSignPersonalMessage.js';\nexport * from './iotaReportTransactionEffects.js';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AA6CA,6BAAc,qCA7Cd;AA8CA,6BAAc,+CA9Cd;AA+CA,6BAAc,yCA/Cd;AAgDA,6BAAc,8CAhDd;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,22 @@
1
+ import type { IdentifierString, WalletAccount } from '@wallet-standard/core';
2
+ /**
3
+ * A Wallet Standard feature for reporting the effects of a transaction block executed by a dapp
4
+ * The feature allows wallets to updated their caches using the effects of the transaction
5
+ * executed outside of the wallet
6
+ */
7
+ export type IotaReportTransactionEffectsFeature = {
8
+ /** Namespace for the feature. */
9
+ 'iota:reportTransactionEffects': {
10
+ /** Version of the feature API. */
11
+ version: '1.0.0';
12
+ reportTransactionEffects: IotaReportTransactionEffectsMethod;
13
+ };
14
+ };
15
+ export type IotaReportTransactionEffectsMethod = (input: IotaReportTransactionEffectsInput) => Promise<void>;
16
+ /** Input for signing transactions. */
17
+ export interface IotaReportTransactionEffectsInput {
18
+ account: WalletAccount;
19
+ chain: IdentifierString;
20
+ /** Transaction effects as base64 encoded bcs. */
21
+ effects: string;
22
+ }
@@ -12,6 +12,6 @@ var __copyProps = (to, from, except, desc) => {
12
12
  return to;
13
13
  };
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var iotaSignAndExecuteTransactionBlock_exports = {};
16
- module.exports = __toCommonJS(iotaSignAndExecuteTransactionBlock_exports);
17
- //# sourceMappingURL=iotaSignAndExecuteTransactionBlock.js.map
15
+ var iotaReportTransactionEffects_exports = {};
16
+ module.exports = __toCommonJS(iotaReportTransactionEffects_exports);
17
+ //# sourceMappingURL=iotaReportTransactionEffects.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/iotaReportTransactionEffects.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 { IdentifierString, WalletAccount } from '@wallet-standard/core';\n\n/**\n * A Wallet Standard feature for reporting the effects of a transaction block executed by a dapp\n * The feature allows wallets to updated their caches using the effects of the transaction\n * executed outside of the wallet\n */\nexport type IotaReportTransactionEffectsFeature = {\n /** Namespace for the feature. */\n 'iota:reportTransactionEffects': {\n /** Version of the feature API. */\n version: '1.0.0';\n reportTransactionEffects: IotaReportTransactionEffectsMethod;\n };\n};\n\nexport type IotaReportTransactionEffectsMethod = (\n input: IotaReportTransactionEffectsInput,\n) => Promise<void>;\n\n/** Input for signing transactions. */\nexport interface IotaReportTransactionEffectsInput {\n account: WalletAccount;\n chain: IdentifierString;\n /** Transaction effects as base64 encoded bcs. */\n effects: string;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,29 @@
1
+ import type { IotaTransactionBlockResponseOptions } from '@iota/iota-sdk/client';
2
+ import type { SignedTransaction, IotaSignTransactionInput } from './iotaSignTransaction.js';
3
+ /** The latest API version of the signAndExecuteTransactionBlock API. */
4
+ export type IotaSignAndExecuteTransactionVersion = '2.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 IotaSignAndExecuteTransactionFeature = {
11
+ /** Namespace for the feature. */
12
+ 'iota:signAndExecuteTransaction': {
13
+ /** Version of the feature API. */
14
+ version: IotaSignAndExecuteTransactionVersion;
15
+ signAndExecuteTransaction: IotaSignAndExecuteTransactionMethod;
16
+ };
17
+ };
18
+ export type IotaSignAndExecuteTransactionMethod = (input: IotaSignAndExecuteTransactionInput) => Promise<IotaSignAndExecuteTransactionOutput>;
19
+ /** Input for signing and sending transactions. */
20
+ export interface IotaSignAndExecuteTransactionInput extends IotaSignTransactionInput {
21
+ /** specify which fields to return (e.g., transaction, effects, events, etc). By default, only the transaction digest will be returned. */
22
+ options?: IotaTransactionBlockResponseOptions;
23
+ }
24
+ /** Output of signing and sending transactions. */
25
+ export interface IotaSignAndExecuteTransactionOutput extends SignedTransaction {
26
+ digest: string;
27
+ /** Transaction effects as base64 encoded bcs. */
28
+ effects: string;
29
+ }
@@ -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 iotaSignAndExecuteTransaction_exports = {};
16
+ module.exports = __toCommonJS(iotaSignAndExecuteTransaction_exports);
17
+ //# sourceMappingURL=iotaSignAndExecuteTransaction.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/iotaSignAndExecuteTransaction.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 { IotaTransactionBlockResponseOptions } from '@iota/iota-sdk/client';\nimport type { SignedTransaction, IotaSignTransactionInput } from './iotaSignTransaction.js';\n\n/** The latest API version of the signAndExecuteTransactionBlock API. */\nexport type IotaSignAndExecuteTransactionVersion = '2.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 IotaSignAndExecuteTransactionFeature = {\n /** Namespace for the feature. */\n 'iota:signAndExecuteTransaction': {\n /** Version of the feature API. */\n version: IotaSignAndExecuteTransactionVersion;\n signAndExecuteTransaction: IotaSignAndExecuteTransactionMethod;\n };\n};\n\nexport type IotaSignAndExecuteTransactionMethod = (\n input: IotaSignAndExecuteTransactionInput,\n) => Promise<IotaSignAndExecuteTransactionOutput>;\n\n/** Input for signing and sending transactions. */\nexport interface IotaSignAndExecuteTransactionInput extends IotaSignTransactionInput {\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 IotaSignAndExecuteTransactionOutput extends SignedTransaction {\n digest: string;\n /** Transaction effects as base64 encoded bcs. */\n effects: string;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -23,6 +23,8 @@ export interface IotaSignPersonalMessageInput {
23
23
  export interface IotaSignPersonalMessageOutput extends SignedPersonalMessage {
24
24
  }
25
25
  export interface SignedPersonalMessage {
26
+ /** Base64 encoded message bytes */
26
27
  bytes: string;
28
+ /** Base64 encoded signature */
27
29
  signature: string;
28
30
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/features/iotaSignPersonalMessage.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/** The latest API version of the signPersonalMessage API. */\nexport type IotaSignPersonalMessageVersion = '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 IotaSignPersonalMessageFeature = {\n /** Namespace for the feature. */\n 'iota:signPersonalMessage': {\n /** Version of the feature API. */\n version: IotaSignPersonalMessageVersion;\n signPersonalMessage: IotaSignPersonalMessageMethod;\n };\n};\n\nexport type IotaSignPersonalMessageMethod = (\n input: IotaSignPersonalMessageInput,\n) => Promise<IotaSignPersonalMessageOutput>;\n\n/** Input for signing personal messages. */\nexport interface IotaSignPersonalMessageInput {\n message: Uint8Array;\n account: WalletAccount;\n}\n\n/** Output of signing personal messages. */\nexport interface IotaSignPersonalMessageOutput extends SignedPersonalMessage {}\n\nexport interface SignedPersonalMessage {\n bytes: string;\n signature: string;\n}\n"],
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/** The latest API version of the signPersonalMessage API. */\nexport type IotaSignPersonalMessageVersion = '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 IotaSignPersonalMessageFeature = {\n /** Namespace for the feature. */\n 'iota:signPersonalMessage': {\n /** Version of the feature API. */\n version: IotaSignPersonalMessageVersion;\n signPersonalMessage: IotaSignPersonalMessageMethod;\n };\n};\n\nexport type IotaSignPersonalMessageMethod = (\n input: IotaSignPersonalMessageInput,\n) => Promise<IotaSignPersonalMessageOutput>;\n\n/** Input for signing personal messages. */\nexport interface IotaSignPersonalMessageInput {\n message: Uint8Array;\n account: WalletAccount;\n}\n\n/** Output of signing personal messages. */\nexport interface IotaSignPersonalMessageOutput extends SignedPersonalMessage {}\n\nexport interface SignedPersonalMessage {\n /** Base64 encoded message bytes */\n bytes: string;\n /** Base64 encoded signature */\n signature: string;\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,34 @@
1
+ import type { IdentifierString, WalletAccount } from '@wallet-standard/core';
2
+ /** The latest API version of the signTransaction API. */
3
+ export type IotaSignTransactionVersion = '2.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 IotaSignTransactionFeature = {
9
+ /** Namespace for the feature. */
10
+ 'iota:signTransaction': {
11
+ /** Version of the feature API. */
12
+ version: IotaSignTransactionVersion;
13
+ signTransaction: IotaSignTransactionMethod;
14
+ };
15
+ };
16
+ export type IotaSignTransactionMethod = (input: IotaSignTransactionInput) => Promise<SignedTransaction>;
17
+ /** Input for signing transactions. */
18
+ export interface IotaSignTransactionInput {
19
+ transaction: {
20
+ toJSON: () => Promise<string>;
21
+ };
22
+ account: WalletAccount;
23
+ chain: IdentifierString;
24
+ signal?: AbortSignal;
25
+ }
26
+ /** Output of signing transactions. */
27
+ export interface SignedTransaction {
28
+ /** Transaction as base64 encoded bcs. */
29
+ bytes: string;
30
+ /** Base64 encoded signature */
31
+ signature: string;
32
+ }
33
+ export interface IotaSignTransactionOutput extends SignedTransaction {
34
+ }
@@ -12,6 +12,6 @@ var __copyProps = (to, from, except, desc) => {
12
12
  return to;
13
13
  };
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var iotaSignTransactionBlock_exports = {};
16
- module.exports = __toCommonJS(iotaSignTransactionBlock_exports);
17
- //# sourceMappingURL=iotaSignTransactionBlock.js.map
15
+ var iotaSignTransaction_exports = {};
16
+ module.exports = __toCommonJS(iotaSignTransaction_exports);
17
+ //# sourceMappingURL=iotaSignTransaction.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/iotaSignTransaction.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 { IdentifierString, WalletAccount } from '@wallet-standard/core';\n\n/** The latest API version of the signTransaction API. */\nexport type IotaSignTransactionVersion = '2.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 IotaSignTransactionFeature = {\n /** Namespace for the feature. */\n 'iota:signTransaction': {\n /** Version of the feature API. */\n version: IotaSignTransactionVersion;\n signTransaction: IotaSignTransactionMethod;\n };\n};\n\nexport type IotaSignTransactionMethod = (\n input: IotaSignTransactionInput,\n) => Promise<SignedTransaction>;\n\n/** Input for signing transactions. */\nexport interface IotaSignTransactionInput {\n transaction: { toJSON: () => Promise<string> };\n account: WalletAccount;\n chain: IdentifierString;\n signal?: AbortSignal;\n}\n\n/** Output of signing transactions. */\n\nexport interface SignedTransaction {\n /** Transaction as base64 encoded bcs. */\n bytes: string;\n /** Base64 encoded signature */\n signature: string;\n}\n\nexport interface IotaSignTransactionOutput extends SignedTransaction {}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,5 +1,6 @@
1
1
  export * from '@wallet-standard/core';
2
- export type { Wallet } from './wallet.js';
2
+ export { type Wallet, signAndExecuteTransaction, signTransaction } from './wallet.js';
3
3
  export * from './features/index.js';
4
4
  export * from './detect.js';
5
5
  export * from './chains.js';
6
+ export * from './types.js';
package/dist/cjs/index.js CHANGED
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
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
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -14,9 +18,15 @@ var __copyProps = (to, from, except, desc) => {
14
18
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
20
  var src_exports = {};
21
+ __export(src_exports, {
22
+ signAndExecuteTransaction: () => import_wallet.signAndExecuteTransaction,
23
+ signTransaction: () => import_wallet.signTransaction
24
+ });
17
25
  module.exports = __toCommonJS(src_exports);
18
26
  __reExport(src_exports, require("@wallet-standard/core"), module.exports);
27
+ var import_wallet = require("./wallet.js");
19
28
  __reExport(src_exports, require("./features/index.js"), module.exports);
20
29
  __reExport(src_exports, require("./detect.js"), module.exports);
21
30
  __reExport(src_exports, require("./chains.js"), module.exports);
31
+ __reExport(src_exports, require("./types.js"), module.exports);
22
32
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// Modifications Copyright (c) 2024 IOTA Stiftung\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;AAIA,wBAAc,kCAJd;AAOA,wBAAc,gCAPd;AAQA,wBAAc,wBARd;AASA,wBAAc,wBATd;",
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// Modifications Copyright (c) 2024 IOTA Stiftung\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from '@wallet-standard/core';\n\nexport { type Wallet, signAndExecuteTransaction, signTransaction } from './wallet.js';\nexport * from './features/index.js';\nexport * from './detect.js';\nexport * from './chains.js';\nexport * from './types.js';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,wBAAc,kCAJd;AAMA,oBAAwE;AACxE,wBAAc,gCAPd;AAQA,wBAAc,wBARd;AASA,wBAAc,wBATd;AAUA,wBAAc,uBAVd;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,156 @@
1
+ /** Contains data related to the gas payment for a Transaction */
2
+ export interface GasData {
3
+ /** The budget set for this transaction */
4
+ budget: string | number | null;
5
+ /** The gas price used for this transaction */
6
+ price: string | number | null;
7
+ /** The owner of the gas coins used to fund the transactions, this is either the sender or the gas sponsor */
8
+ owner: string | null;
9
+ /** The list of IOTA coins to fund the transaction */
10
+ payment: {
11
+ objectId: string;
12
+ version: string;
13
+ digest: string;
14
+ }[] | null;
15
+ }
16
+ /**
17
+ * Represent the serialized state of a partially built Transaction
18
+ * This format is designed to support transactions that have not been fully build
19
+ * allowing most properties to be omitted or set to null. It also supports
20
+ * unresolved object references, unresolved pure values, and Transaction Intents.
21
+ */
22
+ export interface SerializedTransactionDataV2 {
23
+ version: 2;
24
+ /** The sender of the transaction */
25
+ sender: string | null | undefined;
26
+ /** The expiration of the transaction */
27
+ expiration: {
28
+ Epoch: number;
29
+ } | {
30
+ None: true;
31
+ } | null | undefined;
32
+ /** The gas data */
33
+ gasData: GasData;
34
+ /** The inputs to the transaction */
35
+ inputs: CallArg[];
36
+ /** The commands to execute */
37
+ commands: Command[];
38
+ /** Extra metadata for implementation specific use-cases */
39
+ extensions?: {
40
+ [key: string]: unknown;
41
+ };
42
+ }
43
+ /**
44
+ * Represents an input to a Transaction, either as a fully resolved Object or Pure input
45
+ * or as an unresolved partial reference which needs to be resolved before the transaction
46
+ * can be serialized to bcs and executed.
47
+ */
48
+ export type CallArg = {
49
+ Object: ObjectArg;
50
+ } | {
51
+ Pure: PureArg;
52
+ } | {
53
+ UnresolvedPure: UnresolvedPureArg;
54
+ } | {
55
+ UnresolvedObject: UnresolvedObjectArg;
56
+ };
57
+ export type ObjectArg = {
58
+ ImmOrOwnedObject: {
59
+ objectId: string;
60
+ version: string | number;
61
+ digest: string;
62
+ };
63
+ } | {
64
+ SharedObject: {
65
+ objectId: string;
66
+ initialSharedVersion: string;
67
+ mutable: boolean;
68
+ };
69
+ } | {
70
+ Receiving: {
71
+ objectId: string;
72
+ version: string | number;
73
+ digest: string;
74
+ };
75
+ };
76
+ export interface PureArg {
77
+ bytes: string;
78
+ }
79
+ /**
80
+ * Represents an un-serialized pure value.
81
+ * The correct bcs schema will need to be determined before this value can be serialized to bcs */
82
+ export interface UnresolvedPureArg {
83
+ value: unknown;
84
+ }
85
+ /**
86
+ * Represents an unresolved object reference. This allows objects to be referenced by only their ID.
87
+ * version and digest details may also be added to unresolved object references.
88
+ * To fully resolve a reference, the correct ObjectArg type needs to be determined based on the type of object,
89
+ * 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)
90
+ */
91
+ export interface UnresolvedObjectArg {
92
+ objectId: string;
93
+ version?: string | null | undefined;
94
+ digest?: string | null | undefined;
95
+ initialSharedVersion?: string | null | undefined;
96
+ }
97
+ export type Argument = {
98
+ GasCoin: true;
99
+ } | {
100
+ Input: number;
101
+ } | {
102
+ Result: number;
103
+ } | {
104
+ NestedResult: [number, number];
105
+ };
106
+ export type Command = {
107
+ MoveCall: {
108
+ package: string;
109
+ module: string;
110
+ function: string;
111
+ typeArguments: string[];
112
+ arguments: Argument[];
113
+ };
114
+ } | {
115
+ TransferObjects: {
116
+ objects: Argument[];
117
+ address: Argument;
118
+ };
119
+ } | {
120
+ SplitCoins: {
121
+ coin: Argument;
122
+ amounts: Argument[];
123
+ };
124
+ } | {
125
+ MergeCoins: {
126
+ destination: Argument;
127
+ sources: Argument[];
128
+ };
129
+ } | {
130
+ Publish: {
131
+ modules: string[];
132
+ dependencies: string[];
133
+ };
134
+ } | {
135
+ MakeMoveVec: {
136
+ type: string | null;
137
+ elements: Argument[];
138
+ };
139
+ } | {
140
+ Upgrade: {
141
+ modules: string[];
142
+ dependencies: string[];
143
+ package: string;
144
+ ticket: Argument;
145
+ };
146
+ } | {
147
+ $Intent: {
148
+ name: string;
149
+ inputs: {
150
+ [key: string]: Argument | Argument[];
151
+ };
152
+ data: {
153
+ [key: string]: unknown;
154
+ };
155
+ };
156
+ };
@@ -12,6 +12,6 @@ var __copyProps = (to, from, except, desc) => {
12
12
  return to;
13
13
  };
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var iotaSignMessage_exports = {};
16
- module.exports = __toCommonJS(iotaSignMessage_exports);
17
- //# sourceMappingURL=iotaSignMessage.js.map
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
17
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/types.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// Modifications Copyright (c) 2024 IOTA Stiftung\n// SPDX-License-Identifier: Apache-2.0\n\n/** Contains data related to the gas payment for a Transaction */\nexport interface GasData {\n /** The budget set for this transaction */\n budget: string | number | null;\n /** The gas price used for this transaction */\n price: string | number | null;\n /** The owner of the gas coins used to fund the transactions, this is either the sender or the gas sponsor */\n owner: string | null;\n /** The list of IOTA coins to fund the transaction */\n payment: { objectId: string; version: string; digest: string }[] | null;\n}\n\n/**\n * Represent the serialized state of a partially built Transaction\n * This format is designed to support transactions that have not been fully build\n * allowing most properties to be omitted or set to null. It also supports\n * unresolved object references, unresolved pure values, and Transaction Intents.\n */\nexport interface SerializedTransactionDataV2 {\n version: 2;\n /** The sender of the transaction */\n sender: string | null | undefined;\n /** The expiration of the transaction */\n expiration: { Epoch: number } | { None: true } | null | undefined;\n /** The gas data */\n gasData: GasData;\n /** The inputs to the transaction */\n inputs: CallArg[];\n /** The commands to execute */\n commands: Command[];\n /** Extra metadata for implementation specific use-cases */\n extensions?: { [key: string]: unknown };\n}\n\n/**\n * Represents an input to a Transaction, either as a fully resolved Object or Pure input\n * or as an unresolved partial reference which needs to be resolved before the transaction\n * can be serialized to bcs and executed.\n */\nexport type CallArg =\n | {\n Object: ObjectArg;\n }\n | {\n Pure: PureArg;\n }\n | {\n UnresolvedPure: UnresolvedPureArg;\n }\n | {\n UnresolvedObject: UnresolvedObjectArg;\n };\n\nexport type ObjectArg =\n | {\n ImmOrOwnedObject: {\n objectId: string;\n version: string | number;\n digest: string;\n };\n }\n | {\n SharedObject: {\n objectId: string;\n initialSharedVersion: string;\n mutable: boolean;\n };\n }\n | {\n Receiving: {\n objectId: string;\n version: string | number;\n digest: string;\n };\n };\n\nexport interface PureArg {\n bytes: string;\n}\n\n/**\n * Represents an un-serialized pure value.\n * The correct bcs schema will need to be determined before this value can be serialized to bcs */\nexport interface UnresolvedPureArg {\n value: unknown;\n}\n\n/**\n * Represents an unresolved object reference. This allows objects to be referenced by only their ID.\n * version and digest details may also be added to unresolved object references.\n * To fully resolve a reference, the correct ObjectArg type needs to be determined based on the type of object,\n * 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)\n */\nexport interface UnresolvedObjectArg {\n objectId: string;\n version?: string | null | undefined;\n digest?: string | null | undefined;\n initialSharedVersion?: string | null | undefined;\n}\n\nexport type Argument =\n | {\n GasCoin: true;\n }\n | {\n Input: number;\n }\n | {\n Result: number;\n }\n | {\n NestedResult: [number, number];\n };\n\nexport type Command =\n | {\n MoveCall: {\n package: string;\n module: string;\n function: string;\n typeArguments: string[];\n arguments: Argument[];\n };\n }\n | {\n TransferObjects: {\n objects: Argument[];\n address: Argument;\n };\n }\n | {\n SplitCoins: {\n coin: Argument;\n amounts: Argument[];\n };\n }\n | {\n MergeCoins: {\n destination: Argument;\n sources: Argument[];\n };\n }\n | {\n Publish: {\n modules: string[];\n dependencies: string[];\n };\n }\n | {\n MakeMoveVec: {\n type: string | null;\n elements: Argument[];\n };\n }\n | {\n Upgrade: {\n modules: string[];\n dependencies: string[];\n package: string;\n ticket: Argument;\n };\n }\n | {\n $Intent: {\n name: string;\n inputs: { [key: string]: Argument | Argument[] };\n data: { [key: string]: unknown };\n };\n };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,3 +1,5 @@
1
+ import type { WalletWithFeatures } from '@wallet-standard/core';
2
+ import type { IotaSignAndExecuteTransactionInput, IotaSignTransactionInput, IotaWalletFeatures } from './features/index.js';
1
3
  declare module '@wallet-standard/core' {
2
4
  interface Wallet {
3
5
  /**
@@ -7,5 +9,10 @@ declare module '@wallet-standard/core' {
7
9
  */
8
10
  readonly id?: string;
9
11
  }
12
+ interface StandardConnectOutput {
13
+ supportedIntents?: string[];
14
+ }
10
15
  }
11
16
  export type { Wallet } from '@wallet-standard/core';
17
+ export declare function signAndExecuteTransaction(wallet: WalletWithFeatures<Partial<IotaWalletFeatures>>, input: IotaSignAndExecuteTransactionInput): Promise<import("./features/iotaSignAndExecuteTransaction.js").IotaSignAndExecuteTransactionOutput>;
18
+ export declare function signTransaction(wallet: WalletWithFeatures<Partial<IotaWalletFeatures>>, input: IotaSignTransactionInput): Promise<import("./features/iotaSignTransaction.js").SignedTransaction>;
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
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
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -13,5 +17,25 @@ var __copyProps = (to, from, except, desc) => {
13
17
  };
14
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
19
  var wallet_exports = {};
20
+ __export(wallet_exports, {
21
+ signAndExecuteTransaction: () => signAndExecuteTransaction,
22
+ signTransaction: () => signTransaction
23
+ });
16
24
  module.exports = __toCommonJS(wallet_exports);
25
+ async function signAndExecuteTransaction(wallet, input) {
26
+ if (!wallet.features["iota:signAndExecuteTransaction"]) {
27
+ throw new Error(
28
+ `Provided wallet (${wallet.name}) does not support the signAndExecuteTransaction feature.`
29
+ );
30
+ }
31
+ return wallet.features["iota:signAndExecuteTransaction"].signAndExecuteTransaction(input);
32
+ }
33
+ async function signTransaction(wallet, input) {
34
+ if (!wallet.features["iota:signTransaction"]) {
35
+ throw new Error(
36
+ `Provided wallet (${wallet.name}) does not support the signTransaction feature.`
37
+ );
38
+ }
39
+ return wallet.features["iota:signTransaction"].signTransaction(input);
40
+ }
17
41
  //# sourceMappingURL=wallet.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/wallet.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// Modifications Copyright (c) 2024 IOTA Stiftung\n// SPDX-License-Identifier: Apache-2.0\n\ndeclare module '@wallet-standard/core' {\n export interface Wallet {\n /**\n * Unique identifier of the Wallet.\n *\n * If not provided, the wallet name will be used as the identifier.\n */\n readonly id?: string;\n }\n}\n\nexport type { Wallet } from '@wallet-standard/core';\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// Modifications Copyright (c) 2024 IOTA Stiftung\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { WalletWithFeatures } from '@wallet-standard/core';\n\nimport type {\n IotaSignAndExecuteTransactionInput,\n IotaSignTransactionInput,\n IotaWalletFeatures,\n} from './features/index.js';\n\ndeclare module '@wallet-standard/core' {\n export interface Wallet {\n /**\n * Unique identifier of the Wallet.\n *\n * If not provided, the wallet name will be used as the identifier.\n */\n readonly id?: string;\n }\n\n export interface StandardConnectOutput {\n supportedIntents?: string[];\n }\n}\n\nexport type { Wallet } from '@wallet-standard/core';\n\nexport async function signAndExecuteTransaction(\n wallet: WalletWithFeatures<Partial<IotaWalletFeatures>>,\n input: IotaSignAndExecuteTransactionInput,\n) {\n if (!wallet.features['iota:signAndExecuteTransaction']) {\n throw new Error(\n `Provided wallet (${wallet.name}) does not support the signAndExecuteTransaction feature.`,\n );\n }\n\n return wallet.features['iota:signAndExecuteTransaction'].signAndExecuteTransaction(input);\n}\n\nexport async function signTransaction(\n wallet: WalletWithFeatures<Partial<IotaWalletFeatures>>,\n input: IotaSignTransactionInput,\n) {\n if (!wallet.features['iota:signTransaction']) {\n throw new Error(\n `Provided wallet (${wallet.name}) does not support the signTransaction feature.`,\n );\n }\n\n return wallet.features['iota:signTransaction'].signTransaction(input);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BA,eAAsB,0BAClB,QACA,OACF;AACE,MAAI,CAAC,OAAO,SAAS,gCAAgC,GAAG;AACpD,UAAM,IAAI;AAAA,MACN,oBAAoB,OAAO,IAAI;AAAA,IACnC;AAAA,EACJ;AAEA,SAAO,OAAO,SAAS,gCAAgC,EAAE,0BAA0B,KAAK;AAC5F;AAEA,eAAsB,gBAClB,QACA,OACF;AACE,MAAI,CAAC,OAAO,SAAS,sBAAsB,GAAG;AAC1C,UAAM,IAAI;AAAA,MACN,oBAAoB,OAAO,IAAI;AAAA,IACnC;AAAA,EACJ;AAEA,SAAO,OAAO,SAAS,sBAAsB,EAAE,gBAAgB,KAAK;AACxE;",
6
6
  "names": []
7
7
  }