@haneullabs/wallet-standard 0.1.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 (105) hide show
  1. package/CHANGELOG.md +1438 -0
  2. package/README.md +6 -0
  3. package/dist/cjs/chains.d.ts +16 -0
  4. package/dist/cjs/chains.js +42 -0
  5. package/dist/cjs/chains.js.map +7 -0
  6. package/dist/cjs/detect.d.ts +3 -0
  7. package/dist/cjs/detect.js +31 -0
  8. package/dist/cjs/detect.js.map +7 -0
  9. package/dist/cjs/features/haneulGetCapabilities.d.ts +15 -0
  10. package/dist/cjs/features/haneulGetCapabilities.js +25 -0
  11. package/dist/cjs/features/haneulGetCapabilities.js.map +7 -0
  12. package/dist/cjs/features/haneulReportTransactionEffects.d.ts +26 -0
  13. package/dist/cjs/features/haneulReportTransactionEffects.js +25 -0
  14. package/dist/cjs/features/haneulReportTransactionEffects.js.map +7 -0
  15. package/dist/cjs/features/haneulSignAndExecuteTransaction.d.ts +28 -0
  16. package/dist/cjs/features/haneulSignAndExecuteTransaction.js +25 -0
  17. package/dist/cjs/features/haneulSignAndExecuteTransaction.js.map +7 -0
  18. package/dist/cjs/features/haneulSignAndExecuteTransactionBlock.d.ts +36 -0
  19. package/dist/cjs/features/haneulSignAndExecuteTransactionBlock.js +25 -0
  20. package/dist/cjs/features/haneulSignAndExecuteTransactionBlock.js.map +7 -0
  21. package/dist/cjs/features/haneulSignMessage.d.ts +45 -0
  22. package/dist/cjs/features/haneulSignMessage.js +25 -0
  23. package/dist/cjs/features/haneulSignMessage.js.map +7 -0
  24. package/dist/cjs/features/haneulSignPersonalMessage.d.ts +33 -0
  25. package/dist/cjs/features/haneulSignPersonalMessage.js +25 -0
  26. package/dist/cjs/features/haneulSignPersonalMessage.js.map +7 -0
  27. package/dist/cjs/features/haneulSignTransaction.d.ts +34 -0
  28. package/dist/cjs/features/haneulSignTransaction.js +25 -0
  29. package/dist/cjs/features/haneulSignTransaction.js.map +7 -0
  30. package/dist/cjs/features/haneulSignTransactionBlock.d.ts +38 -0
  31. package/dist/cjs/features/haneulSignTransactionBlock.js +25 -0
  32. package/dist/cjs/features/haneulSignTransactionBlock.js.map +7 -0
  33. package/dist/cjs/features/index.d.ts +28 -0
  34. package/dist/cjs/features/index.js +26 -0
  35. package/dist/cjs/features/index.js.map +7 -0
  36. package/dist/cjs/index.d.ts +6 -0
  37. package/dist/cjs/index.js +32 -0
  38. package/dist/cjs/index.js.map +7 -0
  39. package/dist/cjs/package.json +5 -0
  40. package/dist/cjs/types.d.ts +159 -0
  41. package/dist/cjs/types.js +17 -0
  42. package/dist/cjs/types.js.map +7 -0
  43. package/dist/cjs/wallet.d.ts +18 -0
  44. package/dist/cjs/wallet.js +80 -0
  45. package/dist/cjs/wallet.js.map +7 -0
  46. package/dist/esm/chains.d.ts +16 -0
  47. package/dist/esm/chains.js +22 -0
  48. package/dist/esm/chains.js.map +7 -0
  49. package/dist/esm/detect.d.ts +3 -0
  50. package/dist/esm/detect.js +11 -0
  51. package/dist/esm/detect.js.map +7 -0
  52. package/dist/esm/features/haneulGetCapabilities.d.ts +15 -0
  53. package/dist/esm/features/haneulGetCapabilities.js +5 -0
  54. package/dist/esm/features/haneulGetCapabilities.js.map +7 -0
  55. package/dist/esm/features/haneulReportTransactionEffects.d.ts +26 -0
  56. package/dist/esm/features/haneulReportTransactionEffects.js +5 -0
  57. package/dist/esm/features/haneulReportTransactionEffects.js.map +7 -0
  58. package/dist/esm/features/haneulSignAndExecuteTransaction.d.ts +28 -0
  59. package/dist/esm/features/haneulSignAndExecuteTransaction.js +5 -0
  60. package/dist/esm/features/haneulSignAndExecuteTransaction.js.map +7 -0
  61. package/dist/esm/features/haneulSignAndExecuteTransactionBlock.d.ts +36 -0
  62. package/dist/esm/features/haneulSignAndExecuteTransactionBlock.js +5 -0
  63. package/dist/esm/features/haneulSignAndExecuteTransactionBlock.js.map +7 -0
  64. package/dist/esm/features/haneulSignMessage.d.ts +45 -0
  65. package/dist/esm/features/haneulSignMessage.js +5 -0
  66. package/dist/esm/features/haneulSignMessage.js.map +7 -0
  67. package/dist/esm/features/haneulSignPersonalMessage.d.ts +33 -0
  68. package/dist/esm/features/haneulSignPersonalMessage.js +5 -0
  69. package/dist/esm/features/haneulSignPersonalMessage.js.map +7 -0
  70. package/dist/esm/features/haneulSignTransaction.d.ts +34 -0
  71. package/dist/esm/features/haneulSignTransaction.js +5 -0
  72. package/dist/esm/features/haneulSignTransaction.js.map +7 -0
  73. package/dist/esm/features/haneulSignTransactionBlock.d.ts +38 -0
  74. package/dist/esm/features/haneulSignTransactionBlock.js +5 -0
  75. package/dist/esm/features/haneulSignTransactionBlock.js.map +7 -0
  76. package/dist/esm/features/index.d.ts +28 -0
  77. package/dist/esm/features/index.js +9 -0
  78. package/dist/esm/features/index.js.map +7 -0
  79. package/dist/esm/index.d.ts +6 -0
  80. package/dist/esm/index.js +11 -0
  81. package/dist/esm/index.js.map +7 -0
  82. package/dist/esm/package.json +5 -0
  83. package/dist/esm/types.d.ts +159 -0
  84. package/dist/esm/types.js +1 -0
  85. package/dist/esm/types.js.map +7 -0
  86. package/dist/esm/wallet.d.ts +18 -0
  87. package/dist/esm/wallet.js +60 -0
  88. package/dist/esm/wallet.js.map +7 -0
  89. package/dist/tsconfig.esm.tsbuildinfo +1 -0
  90. package/dist/tsconfig.tsbuildinfo +1 -0
  91. package/package.json +50 -0
  92. package/src/chains.ts +33 -0
  93. package/src/detect.ts +20 -0
  94. package/src/features/haneulGetCapabilities.ts +21 -0
  95. package/src/features/haneulReportTransactionEffects.ts +36 -0
  96. package/src/features/haneulSignAndExecuteTransaction.ts +38 -0
  97. package/src/features/haneulSignAndExecuteTransactionBlock.ts +51 -0
  98. package/src/features/haneulSignMessage.ts +54 -0
  99. package/src/features/haneulSignPersonalMessage.ts +44 -0
  100. package/src/features/haneulSignTransaction.ts +44 -0
  101. package/src/features/haneulSignTransactionBlock.ts +49 -0
  102. package/src/features/index.ts +61 -0
  103. package/src/index.ts +10 -0
  104. package/src/types.ts +175 -0
  105. package/src/wallet.ts +100 -0
@@ -0,0 +1,38 @@
1
+ import type { Transaction } from '@haneullabs/haneul/transactions';
2
+ import type { IdentifierString, WalletAccount } from '@wallet-standard/core';
3
+ /** Name of the feature. */
4
+ export declare const HaneulSignTransactionBlock = "sui:signTransactionBlock";
5
+ /** The latest API version of the signTransactionBlock API. */
6
+ export type HaneulSignTransactionBlockVersion = '1.0.0';
7
+ /**
8
+ * @deprecated Use `sui:signTransaction` instead.
9
+ *
10
+ * A Wallet Standard feature for signing a transaction, and returning the
11
+ * serialized transaction and transaction signature.
12
+ */
13
+ export type HaneulSignTransactionBlockFeature = {
14
+ /** Namespace for the feature. */
15
+ [HaneulSignTransactionBlock]: {
16
+ /** Version of the feature API. */
17
+ version: HaneulSignTransactionBlockVersion;
18
+ /** @deprecated Use `sui:signTransaction` instead. */
19
+ signTransactionBlock: HaneulSignTransactionBlockMethod;
20
+ };
21
+ };
22
+ /** @deprecated Use `sui:signTransaction` instead. */
23
+ export type HaneulSignTransactionBlockMethod = (input: HaneulSignTransactionBlockInput) => Promise<HaneulSignTransactionBlockOutput>;
24
+ /** Input for signing transactions. */
25
+ export interface HaneulSignTransactionBlockInput {
26
+ transactionBlock: Transaction;
27
+ account: WalletAccount;
28
+ chain: IdentifierString;
29
+ }
30
+ /** Output of signing transactions. */
31
+ export interface HaneulSignTransactionBlockOutput extends SignedTransactionBlock {
32
+ }
33
+ export interface SignedTransactionBlock {
34
+ /** Transaction as base64 encoded bcs. */
35
+ transactionBlockBytes: string;
36
+ /** Base64 encoded signature */
37
+ signature: string;
38
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var haneulSignTransactionBlock_exports = {};
20
+ __export(haneulSignTransactionBlock_exports, {
21
+ HaneulSignTransactionBlock: () => HaneulSignTransactionBlock
22
+ });
23
+ module.exports = __toCommonJS(haneulSignTransactionBlock_exports);
24
+ const HaneulSignTransactionBlock = "sui:signTransactionBlock";
25
+ //# sourceMappingURL=haneulSignTransactionBlock.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/haneulSignTransactionBlock.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Transaction } from '@haneullabs/haneul/transactions';\nimport type { IdentifierString, WalletAccount } from '@wallet-standard/core';\n\n/** Name of the feature. */\nexport const HaneulSignTransactionBlock = 'sui:signTransactionBlock';\n\n/** The latest API version of the signTransactionBlock API. */\nexport type HaneulSignTransactionBlockVersion = '1.0.0';\n\n/**\n * @deprecated Use `sui:signTransaction` instead.\n *\n * A Wallet Standard feature for signing a transaction, and returning the\n * serialized transaction and transaction signature.\n */\nexport type HaneulSignTransactionBlockFeature = {\n\t/** Namespace for the feature. */\n\t[HaneulSignTransactionBlock]: {\n\t\t/** Version of the feature API. */\n\t\tversion: HaneulSignTransactionBlockVersion;\n\t\t/** @deprecated Use `sui:signTransaction` instead. */\n\t\tsignTransactionBlock: HaneulSignTransactionBlockMethod;\n\t};\n};\n\n/** @deprecated Use `sui:signTransaction` instead. */\nexport type HaneulSignTransactionBlockMethod = (\n\tinput: HaneulSignTransactionBlockInput,\n) => Promise<HaneulSignTransactionBlockOutput>;\n\n/** Input for signing transactions. */\nexport interface HaneulSignTransactionBlockInput {\n\ttransactionBlock: Transaction;\n\taccount: WalletAccount;\n\tchain: IdentifierString;\n}\n\n/** Output of signing transactions. */\nexport interface HaneulSignTransactionBlockOutput extends SignedTransactionBlock {}\n\nexport interface SignedTransactionBlock {\n\t/** Transaction as base64 encoded bcs. */\n\ttransactionBlockBytes: string;\n\t/** Base64 encoded signature */\n\tsignature: string;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,MAAM,6BAA6B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ import type { IdentifierRecord, StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature, WalletWithFeatures } from '@wallet-standard/core';
2
+ import type { HaneulReportTransactionEffectsFeature } from './haneulReportTransactionEffects.js';
3
+ import type { HaneulSignAndExecuteTransactionFeature } from './haneulSignAndExecuteTransaction.js';
4
+ import type { HaneulSignAndExecuteTransactionBlockFeature } from './haneulSignAndExecuteTransactionBlock.js';
5
+ import type { HaneulSignMessageFeature } from './haneulSignMessage.js';
6
+ import type { HaneulSignPersonalMessageFeature } from './haneulSignPersonalMessage.js';
7
+ import type { HaneulSignTransactionFeature } from './haneulSignTransaction.js';
8
+ import type { HaneulSignTransactionBlockFeature } from './haneulSignTransactionBlock.js';
9
+ import type { HaneulGetCapabilitiesFeature } from './haneulGetCapabilities.js';
10
+ /**
11
+ * Wallet Standard features that are unique to Haneul, and that all Haneul wallets are expected to implement.
12
+ */
13
+ export type HaneulFeatures = Partial<HaneulSignTransactionBlockFeature> & Partial<HaneulSignAndExecuteTransactionBlockFeature> & HaneulSignPersonalMessageFeature & HaneulSignAndExecuteTransactionFeature & HaneulSignTransactionFeature & Partial<HaneulSignMessageFeature> & Partial<HaneulReportTransactionEffectsFeature> & Partial<HaneulGetCapabilitiesFeature>;
14
+ export type HaneulWalletFeatures = StandardConnectFeature & StandardEventsFeature & HaneulFeatures & Partial<StandardDisconnectFeature>;
15
+ export type WalletWithHaneulFeatures = WalletWithFeatures<HaneulWalletFeatures>;
16
+ /**
17
+ * Represents a wallet with the absolute minimum feature set required to function in the Haneul ecosystem.
18
+ */
19
+ export type WalletWithRequiredFeatures = WalletWithFeatures<MinimallyRequiredFeatures & Partial<HaneulFeatures> & Partial<StandardDisconnectFeature> & IdentifierRecord<unknown>>;
20
+ export type MinimallyRequiredFeatures = StandardConnectFeature & StandardEventsFeature;
21
+ export * from './haneulSignMessage.js';
22
+ export * from './haneulSignTransactionBlock.js';
23
+ export * from './haneulSignTransaction.js';
24
+ export * from './haneulSignAndExecuteTransactionBlock.js';
25
+ export * from './haneulSignAndExecuteTransaction.js';
26
+ export * from './haneulSignPersonalMessage.js';
27
+ export * from './haneulReportTransactionEffects.js';
28
+ export * from './haneulGetCapabilities.js';
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var features_exports = {};
17
+ module.exports = __toCommonJS(features_exports);
18
+ __reExport(features_exports, require("./haneulSignMessage.js"), module.exports);
19
+ __reExport(features_exports, require("./haneulSignTransactionBlock.js"), module.exports);
20
+ __reExport(features_exports, require("./haneulSignTransaction.js"), module.exports);
21
+ __reExport(features_exports, require("./haneulSignAndExecuteTransactionBlock.js"), module.exports);
22
+ __reExport(features_exports, require("./haneulSignAndExecuteTransaction.js"), module.exports);
23
+ __reExport(features_exports, require("./haneulSignPersonalMessage.js"), module.exports);
24
+ __reExport(features_exports, require("./haneulReportTransactionEffects.js"), module.exports);
25
+ __reExport(features_exports, require("./haneulGetCapabilities.js"), module.exports);
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/index.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n\tIdentifierRecord,\n\tStandardConnectFeature,\n\tStandardDisconnectFeature,\n\tStandardEventsFeature,\n\tWalletWithFeatures,\n} from '@wallet-standard/core';\n\nimport type { HaneulReportTransactionEffectsFeature } from './haneulReportTransactionEffects.js';\nimport type { HaneulSignAndExecuteTransactionFeature } from './haneulSignAndExecuteTransaction.js';\nimport type { HaneulSignAndExecuteTransactionBlockFeature } from './haneulSignAndExecuteTransactionBlock.js';\nimport type { HaneulSignMessageFeature } from './haneulSignMessage.js';\nimport type { HaneulSignPersonalMessageFeature } from './haneulSignPersonalMessage.js';\nimport type { HaneulSignTransactionFeature } from './haneulSignTransaction.js';\nimport type { HaneulSignTransactionBlockFeature } from './haneulSignTransactionBlock.js';\nimport type { HaneulGetCapabilitiesFeature } from './haneulGetCapabilities.js';\n\n/**\n * Wallet Standard features that are unique to Haneul, and that all Haneul wallets are expected to implement.\n */\nexport type HaneulFeatures = Partial<HaneulSignTransactionBlockFeature> &\n\tPartial<HaneulSignAndExecuteTransactionBlockFeature> &\n\tHaneulSignPersonalMessageFeature &\n\tHaneulSignAndExecuteTransactionFeature &\n\tHaneulSignTransactionFeature &\n\t// This deprecated feature should be removed once wallets update to the new method:\n\tPartial<HaneulSignMessageFeature> &\n\tPartial<HaneulReportTransactionEffectsFeature> &\n\tPartial<HaneulGetCapabilitiesFeature>;\n\nexport type HaneulWalletFeatures = StandardConnectFeature &\n\tStandardEventsFeature &\n\tHaneulFeatures &\n\t// Disconnect is an optional feature:\n\tPartial<StandardDisconnectFeature>;\n\nexport type WalletWithHaneulFeatures = WalletWithFeatures<HaneulWalletFeatures>;\n\n/**\n * Represents a wallet with the absolute minimum feature set required to function in the Haneul ecosystem.\n */\nexport type WalletWithRequiredFeatures = WalletWithFeatures<\n\tMinimallyRequiredFeatures &\n\t\tPartial<HaneulFeatures> &\n\t\tPartial<StandardDisconnectFeature> &\n\t\tIdentifierRecord<unknown>\n>;\n\nexport type MinimallyRequiredFeatures = StandardConnectFeature & StandardEventsFeature;\n\nexport * from './haneulSignMessage.js';\nexport * from './haneulSignTransactionBlock.js';\nexport * from './haneulSignTransaction.js';\nexport * from './haneulSignAndExecuteTransactionBlock.js';\nexport * from './haneulSignAndExecuteTransaction.js';\nexport * from './haneulSignPersonalMessage.js';\nexport * from './haneulReportTransactionEffects.js';\nexport * from './haneulGetCapabilities.js';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAqDA,6BAAc,mCArDd;AAsDA,6BAAc,4CAtDd;AAuDA,6BAAc,uCAvDd;AAwDA,6BAAc,sDAxDd;AAyDA,6BAAc,iDAzDd;AA0DA,6BAAc,2CA1Dd;AA2DA,6BAAc,gDA3Dd;AA4DA,6BAAc,uCA5Dd;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ export * from '@wallet-standard/core';
2
+ export { type Wallet, signAndExecuteTransaction, signTransaction } from './wallet.js';
3
+ export * from './features/index.js';
4
+ export * from './detect.js';
5
+ export * from './chains.js';
6
+ export * from './types.js';
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var index_exports = {};
21
+ __export(index_exports, {
22
+ signAndExecuteTransaction: () => import_wallet.signAndExecuteTransaction,
23
+ signTransaction: () => import_wallet.signTransaction
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+ __reExport(index_exports, require("@wallet-standard/core"), module.exports);
27
+ var import_wallet = require("./wallet.js");
28
+ __reExport(index_exports, require("./features/index.js"), module.exports);
29
+ __reExport(index_exports, require("./detect.js"), module.exports);
30
+ __reExport(index_exports, require("./chains.js"), module.exports);
31
+ __reExport(index_exports, require("./types.js"), module.exports);
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from '@wallet-standard/core';\n\nexport { type Wallet, 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;AAGA,0BAAc,kCAHd;AAKA,oBAAwE;AACxE,0BAAc,gCANd;AAOA,0BAAc,wBAPd;AAQA,0BAAc,wBARd;AASA,0BAAc,uBATd;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "private": true,
3
+ "type": "commonjs",
4
+ "sideEffects": false
5
+ }
@@ -0,0 +1,159 @@
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 SUI 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
+ /** The digest of the transaction, may be set when the transaction is fully resolved */
43
+ digest: string | null | undefined;
44
+ }
45
+ /**
46
+ * Represents an input to a Transaction, either as a fully resolved Object or Pure input
47
+ * or as an unresolved partial reference which needs to be resolved before the transaction
48
+ * can be serialized to bcs and executed.
49
+ */
50
+ export type CallArg = {
51
+ Object: ObjectArg;
52
+ } | {
53
+ Pure: PureArg;
54
+ } | {
55
+ UnresolvedPure: UnresolvedPureArg;
56
+ } | {
57
+ UnresolvedObject: UnresolvedObjectArg;
58
+ };
59
+ export type ObjectArg = {
60
+ ImmOrOwnedObject: {
61
+ objectId: string;
62
+ version: string | number;
63
+ digest: string;
64
+ };
65
+ } | {
66
+ SharedObject: {
67
+ objectId: string;
68
+ initialSharedVersion: string;
69
+ mutable: boolean;
70
+ };
71
+ } | {
72
+ Receiving: {
73
+ objectId: string;
74
+ version: string | number;
75
+ digest: string;
76
+ };
77
+ };
78
+ export interface PureArg {
79
+ bytes: string;
80
+ }
81
+ /**
82
+ * Represents an un-serialized pure value.
83
+ * The correct bcs schema will need to be determined before this value can be serialized to bcs */
84
+ export interface UnresolvedPureArg {
85
+ value: unknown;
86
+ }
87
+ /**
88
+ * Represents an unresolved object reference. This allows objects to be referenced by only their ID.
89
+ * version and digest details may also be added to unresolved object references.
90
+ * To fully resolve a reference, the correct ObjectArg type needs to be determined based on the type of object,
91
+ * 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)
92
+ */
93
+ export interface UnresolvedObjectArg {
94
+ objectId: string;
95
+ version?: string | null | undefined;
96
+ digest?: string | null | undefined;
97
+ initialSharedVersion?: string | null | undefined;
98
+ mutable?: boolean | null | undefined;
99
+ }
100
+ export type Argument = {
101
+ GasCoin: true;
102
+ } | {
103
+ Input: number;
104
+ } | {
105
+ Result: number;
106
+ } | {
107
+ NestedResult: [number, number];
108
+ };
109
+ export type Command = {
110
+ MoveCall: {
111
+ package: string;
112
+ module: string;
113
+ function: string;
114
+ typeArguments: string[];
115
+ arguments: Argument[];
116
+ };
117
+ } | {
118
+ TransferObjects: {
119
+ objects: Argument[];
120
+ address: Argument;
121
+ };
122
+ } | {
123
+ SplitCoins: {
124
+ coin: Argument;
125
+ amounts: Argument[];
126
+ };
127
+ } | {
128
+ MergeCoins: {
129
+ destination: Argument;
130
+ sources: Argument[];
131
+ };
132
+ } | {
133
+ Publish: {
134
+ modules: string[];
135
+ dependencies: string[];
136
+ };
137
+ } | {
138
+ MakeMoveVec: {
139
+ type: string | null;
140
+ elements: Argument[];
141
+ };
142
+ } | {
143
+ Upgrade: {
144
+ modules: string[];
145
+ dependencies: string[];
146
+ package: string;
147
+ ticket: Argument;
148
+ };
149
+ } | {
150
+ $Intent: {
151
+ name: string;
152
+ inputs: {
153
+ [key: string]: Argument | Argument[];
154
+ };
155
+ data: {
156
+ [key: string]: unknown;
157
+ };
158
+ };
159
+ };
@@ -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 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// SPDX-License-Identifier: Apache-2.0\n\n/** Contains data related to the gas payment for a Transaction */\nexport interface GasData {\n\t/** The budget set for this transaction */\n\tbudget: string | number | null;\n\t/** The gas price used for this transaction */\n\tprice: string | number | null;\n\t/** The owner of the gas coins used to fund the transactions, this is either the sender or the gas sponsor */\n\towner: string | null;\n\t/** The list of SUI coins to fund the transaction */\n\tpayment: { 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\tversion: 2;\n\t/** The sender of the transaction */\n\tsender: string | null | undefined;\n\t/** The expiration of the transaction */\n\texpiration: { Epoch: number } | { None: true } | null | undefined;\n\t/** The gas data */\n\tgasData: GasData;\n\t/** The inputs to the transaction */\n\tinputs: CallArg[];\n\t/** The commands to execute */\n\tcommands: Command[];\n\t/** Extra metadata for implementation specific use-cases */\n\textensions?: { [key: string]: unknown };\n\t/** The digest of the transaction, may be set when the transaction is fully resolved */\n\tdigest: string | null | undefined;\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\t| {\n\t\t\tObject: ObjectArg;\n\t }\n\t| {\n\t\t\tPure: PureArg;\n\t }\n\t| {\n\t\t\tUnresolvedPure: UnresolvedPureArg;\n\t }\n\t| {\n\t\t\tUnresolvedObject: UnresolvedObjectArg;\n\t };\n\nexport type ObjectArg =\n\t| {\n\t\t\tImmOrOwnedObject: {\n\t\t\t\tobjectId: string;\n\t\t\t\tversion: string | number;\n\t\t\t\tdigest: string;\n\t\t\t};\n\t }\n\t| {\n\t\t\tSharedObject: {\n\t\t\t\tobjectId: string;\n\t\t\t\tinitialSharedVersion: string;\n\t\t\t\tmutable: boolean;\n\t\t\t};\n\t }\n\t| {\n\t\t\tReceiving: {\n\t\t\t\tobjectId: string;\n\t\t\t\tversion: string | number;\n\t\t\t\tdigest: string;\n\t\t\t};\n\t };\n\nexport interface PureArg {\n\tbytes: 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\tvalue: 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\tobjectId: string;\n\tversion?: string | null | undefined;\n\tdigest?: string | null | undefined;\n\tinitialSharedVersion?: string | null | undefined;\n\tmutable?: boolean | null | undefined;\n}\n\nexport type Argument =\n\t| {\n\t\t\tGasCoin: true;\n\t }\n\t| {\n\t\t\tInput: number;\n\t }\n\t| {\n\t\t\tResult: number;\n\t }\n\t| {\n\t\t\tNestedResult: [number, number];\n\t };\n\nexport type Command =\n\t| {\n\t\t\tMoveCall: {\n\t\t\t\tpackage: string;\n\t\t\t\tmodule: string;\n\t\t\t\tfunction: string;\n\t\t\t\ttypeArguments: string[];\n\t\t\t\targuments: Argument[];\n\t\t\t};\n\t }\n\t| {\n\t\t\tTransferObjects: {\n\t\t\t\tobjects: Argument[];\n\t\t\t\taddress: Argument;\n\t\t\t};\n\t }\n\t| {\n\t\t\tSplitCoins: {\n\t\t\t\tcoin: Argument;\n\t\t\t\tamounts: Argument[];\n\t\t\t};\n\t }\n\t| {\n\t\t\tMergeCoins: {\n\t\t\t\tdestination: Argument;\n\t\t\t\tsources: Argument[];\n\t\t\t};\n\t }\n\t| {\n\t\t\tPublish: {\n\t\t\t\tmodules: string[];\n\t\t\t\tdependencies: string[];\n\t\t\t};\n\t }\n\t| {\n\t\t\tMakeMoveVec: {\n\t\t\t\ttype: string | null;\n\t\t\t\telements: Argument[];\n\t\t\t};\n\t }\n\t| {\n\t\t\tUpgrade: {\n\t\t\t\tmodules: string[];\n\t\t\t\tdependencies: string[];\n\t\t\t\tpackage: string;\n\t\t\t\tticket: Argument;\n\t\t\t};\n\t }\n\t| {\n\t\t\t$Intent: {\n\t\t\t\tname: string;\n\t\t\t\tinputs: { [key: string]: Argument | Argument[] };\n\t\t\t\tdata: { [key: string]: unknown };\n\t\t\t};\n\t };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,18 @@
1
+ import type { WalletWithFeatures } from '@wallet-standard/core';
2
+ import type { HaneulSignAndExecuteTransactionInput, HaneulSignTransactionInput, HaneulWalletFeatures } from './features/index.js';
3
+ declare module '@wallet-standard/core' {
4
+ interface Wallet {
5
+ /**
6
+ * Unique identifier of the Wallet.
7
+ *
8
+ * If not provided, the wallet name will be used as the identifier.
9
+ */
10
+ readonly id?: string;
11
+ }
12
+ interface StandardConnectOutput {
13
+ supportedIntents?: string[];
14
+ }
15
+ }
16
+ export type { Wallet } from '@wallet-standard/core';
17
+ export declare function signAndExecuteTransaction(wallet: WalletWithFeatures<Partial<HaneulWalletFeatures>>, input: HaneulSignAndExecuteTransactionInput): Promise<import("./features/haneulSignAndExecuteTransaction.js").HaneulSignAndExecuteTransactionOutput>;
18
+ export declare function signTransaction(wallet: WalletWithFeatures<Partial<HaneulWalletFeatures>>, input: HaneulSignTransactionInput): Promise<import("./features/haneulSignTransaction.js").SignedTransaction>;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var wallet_exports = {};
20
+ __export(wallet_exports, {
21
+ signAndExecuteTransaction: () => signAndExecuteTransaction,
22
+ signTransaction: () => signTransaction
23
+ });
24
+ module.exports = __toCommonJS(wallet_exports);
25
+ var import_bcs = require("@haneullabs/haneul/bcs");
26
+ var import_transactions = require("@haneullabs/haneul/transactions");
27
+ var import_utils = require("@haneullabs/haneul/utils");
28
+ async function signAndExecuteTransaction(wallet, input) {
29
+ if (wallet.features["sui:signAndExecuteTransaction"]) {
30
+ return wallet.features["sui:signAndExecuteTransaction"].signAndExecuteTransaction(input);
31
+ }
32
+ if (!wallet.features["sui:signAndExecuteTransactionBlock"]) {
33
+ throw new Error(
34
+ `Provided wallet (${wallet.name}) does not support the signAndExecuteTransaction feature.`
35
+ );
36
+ }
37
+ const { signAndExecuteTransactionBlock } = wallet.features["sui:signAndExecuteTransactionBlock"];
38
+ const transactionBlock = import_transactions.Transaction.from(await input.transaction.toJSON());
39
+ const { digest, rawEffects, rawTransaction } = await signAndExecuteTransactionBlock({
40
+ account: input.account,
41
+ chain: input.chain,
42
+ transactionBlock,
43
+ options: {
44
+ showRawEffects: true,
45
+ showRawInput: true
46
+ }
47
+ });
48
+ const [
49
+ {
50
+ txSignatures: [signature],
51
+ intentMessage: { value: bcsTransaction }
52
+ }
53
+ ] = import_bcs.bcs.SenderSignedData.parse((0, import_utils.fromBase64)(rawTransaction));
54
+ const bytes = import_bcs.bcs.TransactionData.serialize(bcsTransaction).toBase64();
55
+ return {
56
+ digest,
57
+ signature,
58
+ bytes,
59
+ effects: (0, import_utils.toBase64)(new Uint8Array(rawEffects))
60
+ };
61
+ }
62
+ async function signTransaction(wallet, input) {
63
+ if (wallet.features["sui:signTransaction"]) {
64
+ return wallet.features["sui:signTransaction"].signTransaction(input);
65
+ }
66
+ if (!wallet.features["sui:signTransactionBlock"]) {
67
+ throw new Error(
68
+ `Provided wallet (${wallet.name}) does not support the signTransaction feature.`
69
+ );
70
+ }
71
+ const { signTransactionBlock } = wallet.features["sui:signTransactionBlock"];
72
+ const transaction = import_transactions.Transaction.from(await input.transaction.toJSON());
73
+ const { transactionBlockBytes, signature } = await signTransactionBlock({
74
+ transactionBlock: transaction,
75
+ account: input.account,
76
+ chain: input.chain
77
+ });
78
+ return { bytes: transactionBlockBytes, signature };
79
+ }
80
+ //# sourceMappingURL=wallet.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/wallet.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bcs } from '@haneullabs/haneul/bcs';\nimport { Transaction } from '@haneullabs/haneul/transactions';\nimport { fromBase64, toBase64 } from '@haneullabs/haneul/utils';\nimport type { WalletWithFeatures } from '@wallet-standard/core';\n\nimport type {\n\tHaneulSignAndExecuteTransactionInput,\n\tHaneulSignTransactionInput,\n\tHaneulWalletFeatures,\n} from './features/index.js';\n\ndeclare module '@wallet-standard/core' {\n\texport interface Wallet {\n\t\t/**\n\t\t * Unique identifier of the Wallet.\n\t\t *\n\t\t * If not provided, the wallet name will be used as the identifier.\n\t\t */\n\t\treadonly id?: string;\n\t}\n\n\texport interface StandardConnectOutput {\n\t\tsupportedIntents?: string[];\n\t}\n}\n\nexport type { Wallet } from '@wallet-standard/core';\n\nexport async function signAndExecuteTransaction(\n\twallet: WalletWithFeatures<Partial<HaneulWalletFeatures>>,\n\tinput: HaneulSignAndExecuteTransactionInput,\n) {\n\tif (wallet.features['sui:signAndExecuteTransaction']) {\n\t\treturn wallet.features['sui:signAndExecuteTransaction'].signAndExecuteTransaction(input);\n\t}\n\n\tif (!wallet.features['sui:signAndExecuteTransactionBlock']) {\n\t\tthrow new Error(\n\t\t\t`Provided wallet (${wallet.name}) does not support the signAndExecuteTransaction feature.`,\n\t\t);\n\t}\n\n\tconst { signAndExecuteTransactionBlock } = wallet.features['sui:signAndExecuteTransactionBlock'];\n\n\tconst transactionBlock = Transaction.from(await input.transaction.toJSON());\n\tconst { digest, rawEffects, rawTransaction } = await signAndExecuteTransactionBlock({\n\t\taccount: input.account,\n\t\tchain: input.chain,\n\t\ttransactionBlock,\n\t\toptions: {\n\t\t\tshowRawEffects: true,\n\t\t\tshowRawInput: true,\n\t\t},\n\t});\n\n\tconst [\n\t\t{\n\t\t\ttxSignatures: [signature],\n\t\t\tintentMessage: { value: bcsTransaction },\n\t\t},\n\t] = bcs.SenderSignedData.parse(fromBase64(rawTransaction!));\n\n\tconst bytes = bcs.TransactionData.serialize(bcsTransaction).toBase64();\n\n\treturn {\n\t\tdigest,\n\t\tsignature,\n\t\tbytes,\n\t\teffects: toBase64(new Uint8Array(rawEffects!)),\n\t};\n}\n\nexport async function signTransaction(\n\twallet: WalletWithFeatures<Partial<HaneulWalletFeatures>>,\n\tinput: HaneulSignTransactionInput,\n) {\n\tif (wallet.features['sui:signTransaction']) {\n\t\treturn wallet.features['sui:signTransaction'].signTransaction(input);\n\t}\n\n\tif (!wallet.features['sui:signTransactionBlock']) {\n\t\tthrow new Error(\n\t\t\t`Provided wallet (${wallet.name}) does not support the signTransaction feature.`,\n\t\t);\n\t}\n\n\tconst { signTransactionBlock } = wallet.features['sui:signTransactionBlock'];\n\n\tconst transaction = Transaction.from(await input.transaction.toJSON());\n\tconst { transactionBlockBytes, signature } = await signTransactionBlock({\n\t\ttransactionBlock: transaction,\n\t\taccount: input.account,\n\t\tchain: input.chain,\n\t});\n\n\treturn { bytes: transactionBlockBytes, signature };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAAoB;AACpB,0BAA4B;AAC5B,mBAAqC;AA0BrC,eAAsB,0BACrB,QACA,OACC;AACD,MAAI,OAAO,SAAS,+BAA+B,GAAG;AACrD,WAAO,OAAO,SAAS,+BAA+B,EAAE,0BAA0B,KAAK;AAAA,EACxF;AAEA,MAAI,CAAC,OAAO,SAAS,oCAAoC,GAAG;AAC3D,UAAM,IAAI;AAAA,MACT,oBAAoB,OAAO,IAAI;AAAA,IAChC;AAAA,EACD;AAEA,QAAM,EAAE,+BAA+B,IAAI,OAAO,SAAS,oCAAoC;AAE/F,QAAM,mBAAmB,gCAAY,KAAK,MAAM,MAAM,YAAY,OAAO,CAAC;AAC1E,QAAM,EAAE,QAAQ,YAAY,eAAe,IAAI,MAAM,+BAA+B;AAAA,IACnF,SAAS,MAAM;AAAA,IACf,OAAO,MAAM;AAAA,IACb;AAAA,IACA,SAAS;AAAA,MACR,gBAAgB;AAAA,MAChB,cAAc;AAAA,IACf;AAAA,EACD,CAAC;AAED,QAAM;AAAA,IACL;AAAA,MACC,cAAc,CAAC,SAAS;AAAA,MACxB,eAAe,EAAE,OAAO,eAAe;AAAA,IACxC;AAAA,EACD,IAAI,eAAI,iBAAiB,UAAM,yBAAW,cAAe,CAAC;AAE1D,QAAM,QAAQ,eAAI,gBAAgB,UAAU,cAAc,EAAE,SAAS;AAErE,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAS,uBAAS,IAAI,WAAW,UAAW,CAAC;AAAA,EAC9C;AACD;AAEA,eAAsB,gBACrB,QACA,OACC;AACD,MAAI,OAAO,SAAS,qBAAqB,GAAG;AAC3C,WAAO,OAAO,SAAS,qBAAqB,EAAE,gBAAgB,KAAK;AAAA,EACpE;AAEA,MAAI,CAAC,OAAO,SAAS,0BAA0B,GAAG;AACjD,UAAM,IAAI;AAAA,MACT,oBAAoB,OAAO,IAAI;AAAA,IAChC;AAAA,EACD;AAEA,QAAM,EAAE,qBAAqB,IAAI,OAAO,SAAS,0BAA0B;AAE3E,QAAM,cAAc,gCAAY,KAAK,MAAM,MAAM,YAAY,OAAO,CAAC;AACrE,QAAM,EAAE,uBAAuB,UAAU,IAAI,MAAM,qBAAqB;AAAA,IACvE,kBAAkB;AAAA,IAClB,SAAS,MAAM;AAAA,IACf,OAAO,MAAM;AAAA,EACd,CAAC;AAED,SAAO,EAAE,OAAO,uBAAuB,UAAU;AAClD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,16 @@
1
+ import type { IdentifierString } from '@wallet-standard/core';
2
+ /** Haneul Devnet */
3
+ export declare const HANEUL_DEVNET_CHAIN = "haneul:devnet";
4
+ /** Haneul Testnet */
5
+ export declare const HANEUL_TESTNET_CHAIN = "haneul:testnet";
6
+ /** Haneul Localnet */
7
+ export declare const HANEUL_LOCALNET_CHAIN = "haneul:localnet";
8
+ /** Haneul Mainnet */
9
+ export declare const HANEUL_MAINNET_CHAIN = "haneul:mainnet";
10
+ export declare const HANEUL_CHAINS: readonly ["haneul:devnet", "haneul:testnet", "haneul:localnet", "haneul:mainnet"];
11
+ export type HaneulChain = (typeof HANEUL_CHAINS)[number];
12
+ /**
13
+ * Utility that returns whether or not a chain identifier is a valid Haneul chain.
14
+ * @param chain a chain identifier in the form of `${string}:{$string}`
15
+ */
16
+ export declare function isHaneulChain(chain: IdentifierString): chain is HaneulChain;
@@ -0,0 +1,22 @@
1
+ const HANEUL_DEVNET_CHAIN = "haneul:devnet";
2
+ const HANEUL_TESTNET_CHAIN = "haneul:testnet";
3
+ const HANEUL_LOCALNET_CHAIN = "haneul:localnet";
4
+ const HANEUL_MAINNET_CHAIN = "haneul:mainnet";
5
+ const HANEUL_CHAINS = [
6
+ HANEUL_DEVNET_CHAIN,
7
+ HANEUL_TESTNET_CHAIN,
8
+ HANEUL_LOCALNET_CHAIN,
9
+ HANEUL_MAINNET_CHAIN
10
+ ];
11
+ function isHaneulChain(chain) {
12
+ return HANEUL_CHAINS.includes(chain);
13
+ }
14
+ export {
15
+ HANEUL_CHAINS,
16
+ HANEUL_DEVNET_CHAIN,
17
+ HANEUL_LOCALNET_CHAIN,
18
+ HANEUL_MAINNET_CHAIN,
19
+ HANEUL_TESTNET_CHAIN,
20
+ isHaneulChain
21
+ };
22
+ //# sourceMappingURL=chains.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/chains.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { IdentifierString } from '@wallet-standard/core';\n\n/** Haneul Devnet */\nexport const HANEUL_DEVNET_CHAIN = 'haneul:devnet';\n\n/** Haneul Testnet */\nexport const HANEUL_TESTNET_CHAIN = 'haneul:testnet';\n\n/** Haneul Localnet */\nexport const HANEUL_LOCALNET_CHAIN = 'haneul:localnet';\n\n/** Haneul Mainnet */\nexport const HANEUL_MAINNET_CHAIN = 'haneul:mainnet';\n\nexport const HANEUL_CHAINS = [\n\tHANEUL_DEVNET_CHAIN,\n\tHANEUL_TESTNET_CHAIN,\n\tHANEUL_LOCALNET_CHAIN,\n\tHANEUL_MAINNET_CHAIN,\n] as const;\n\nexport type HaneulChain = (typeof HANEUL_CHAINS)[number];\n\n/**\n * Utility that returns whether or not a chain identifier is a valid Haneul chain.\n * @param chain a chain identifier in the form of `${string}:{$string}`\n */\nexport function isHaneulChain(chain: IdentifierString): chain is HaneulChain {\n\treturn HANEUL_CHAINS.includes(chain as HaneulChain);\n}\n"],
5
+ "mappings": "AAMO,MAAM,sBAAsB;AAG5B,MAAM,uBAAuB;AAG7B,MAAM,wBAAwB;AAG9B,MAAM,uBAAuB;AAE7B,MAAM,gBAAgB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAQO,SAAS,cAAc,OAA+C;AAC5E,SAAO,cAAc,SAAS,KAAoB;AACnD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,3 @@
1
+ import type { Wallet, WalletWithFeatures } from '@wallet-standard/core';
2
+ import type { MinimallyRequiredFeatures } from './features/index.js';
3
+ export declare function isWalletWithRequiredFeatureSet<AdditionalFeatures extends Wallet['features']>(wallet: Wallet, additionalFeatures?: (keyof AdditionalFeatures)[]): wallet is WalletWithFeatures<MinimallyRequiredFeatures & AdditionalFeatures>;
@@ -0,0 +1,11 @@
1
+ import { StandardConnect, StandardEvents } from "@wallet-standard/core";
2
+ const REQUIRED_FEATURES = [StandardConnect, StandardEvents];
3
+ function isWalletWithRequiredFeatureSet(wallet, additionalFeatures = []) {
4
+ return [...REQUIRED_FEATURES, ...additionalFeatures].every(
5
+ (feature) => feature in wallet.features
6
+ );
7
+ }
8
+ export {
9
+ isWalletWithRequiredFeatureSet
10
+ };
11
+ //# sourceMappingURL=detect.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/detect.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { StandardConnect, StandardEvents } from '@wallet-standard/core';\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 Haneul ecosystem.\n// Eventually, as wallets have more consistent support of features, we may want to extend this list.\nconst REQUIRED_FEATURES: (keyof MinimallyRequiredFeatures)[] = [StandardConnect, StandardEvents];\n\nexport function isWalletWithRequiredFeatureSet<AdditionalFeatures extends Wallet['features']>(\n\twallet: Wallet,\n\tadditionalFeatures: (keyof AdditionalFeatures)[] = [],\n): wallet is WalletWithFeatures<MinimallyRequiredFeatures & AdditionalFeatures> {\n\treturn [...REQUIRED_FEATURES, ...additionalFeatures].every(\n\t\t(feature) => feature in wallet.features,\n\t);\n}\n"],
5
+ "mappings": "AAGA,SAAS,iBAAiB,sBAAsB;AAOhD,MAAM,oBAAyD,CAAC,iBAAiB,cAAc;AAExF,SAAS,+BACf,QACA,qBAAmD,CAAC,GAC2B;AAC/E,SAAO,CAAC,GAAG,mBAAmB,GAAG,kBAAkB,EAAE;AAAA,IACpD,CAAC,YAAY,WAAW,OAAO;AAAA,EAChC;AACD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,15 @@
1
+ export declare const HaneulGetCapabilities = "sui:getCapabilities";
2
+ /** The latest API version of the getCapabilities API. */
3
+ export type HaneulGetCapabilitiesVersion = '1.0.0';
4
+ /**
5
+ * A Wallet Standard feature for reporting intents supported by the wallet.
6
+ */
7
+ export type HaneulGetCapabilitiesFeature = {
8
+ [HaneulGetCapabilities]: {
9
+ version: HaneulGetCapabilitiesVersion;
10
+ getCapabilities: HaneulGetCapabilitiesMethod;
11
+ };
12
+ };
13
+ export type HaneulGetCapabilitiesMethod = () => Promise<{
14
+ supportedIntents?: string[];
15
+ }>;
@@ -0,0 +1,5 @@
1
+ const HaneulGetCapabilities = "sui:getCapabilities";
2
+ export {
3
+ HaneulGetCapabilities
4
+ };
5
+ //# sourceMappingURL=haneulGetCapabilities.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/haneulGetCapabilities.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport const HaneulGetCapabilities = 'sui:getCapabilities';\n\n/** The latest API version of the getCapabilities API. */\nexport type HaneulGetCapabilitiesVersion = '1.0.0';\n\n/**\n * A Wallet Standard feature for reporting intents supported by the wallet.\n */\nexport type HaneulGetCapabilitiesFeature = {\n\t[HaneulGetCapabilities]: {\n\t\tversion: HaneulGetCapabilitiesVersion;\n\t\tgetCapabilities: HaneulGetCapabilitiesMethod;\n\t};\n};\n\nexport type HaneulGetCapabilitiesMethod = () => Promise<{\n\tsupportedIntents?: string[];\n}>;\n"],
5
+ "mappings": "AAGO,MAAM,wBAAwB;",
6
+ "names": []
7
+ }