@arkade-os/sdk 0.5.13 → 0.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -1
- package/dist/adapters/expo.cjs +6 -6
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +3 -3
- package/dist/artifact-DA5YHM2k.d.cts +87 -0
- package/dist/artifact-DacurepK.d.ts +87 -0
- package/dist/{asyncStorageTaskQueue-Dhbe00Ya.d.ts → asyncStorageTaskQueue-B3umqlkb.d.ts} +1 -1
- package/dist/{asyncStorageTaskQueue-Y4BlVm41.d.cts → asyncStorageTaskQueue-Dq6AJHNv.d.cts} +1 -1
- package/dist/{chunk-TYSUFG2K.cjs → chunk-35GRSVCZ.cjs} +11 -11
- package/dist/{chunk-TYSUFG2K.cjs.map → chunk-35GRSVCZ.cjs.map} +1 -1
- package/dist/{chunk-X57WKONW.js → chunk-43APGKWL.js} +130 -22
- package/dist/chunk-43APGKWL.js.map +1 -0
- package/dist/{chunk-6WPP4UGN.cjs → chunk-CMFRCBZW.cjs} +1245 -658
- package/dist/chunk-CMFRCBZW.cjs.map +1 -0
- package/dist/{chunk-HS7TKVOZ.cjs → chunk-FKHUXSYW.cjs} +8 -4
- package/dist/chunk-FKHUXSYW.cjs.map +1 -0
- package/dist/{chunk-BP4NA7HK.js → chunk-HVUZKXB2.js} +4 -4
- package/dist/{chunk-BP4NA7HK.js.map → chunk-HVUZKXB2.js.map} +1 -1
- package/dist/{chunk-6XVTGWQK.cjs → chunk-INQAIZUO.cjs} +17 -17
- package/dist/{chunk-6XVTGWQK.cjs.map → chunk-INQAIZUO.cjs.map} +1 -1
- package/dist/{chunk-WFJPLXOE.cjs → chunk-JSYS2KX3.cjs} +18 -18
- package/dist/{chunk-WFJPLXOE.cjs.map → chunk-JSYS2KX3.cjs.map} +1 -1
- package/dist/{chunk-QSERJPTT.js → chunk-R37I633T.js} +22 -17
- package/dist/chunk-R37I633T.js.map +1 -0
- package/dist/{chunk-ACIQZLWL.cjs → chunk-UNLH3NNG.cjs} +129 -20
- package/dist/chunk-UNLH3NNG.cjs.map +1 -0
- package/dist/{chunk-TD4PKK2I.cjs → chunk-VIQF74QJ.cjs} +38 -33
- package/dist/chunk-VIQF74QJ.cjs.map +1 -0
- package/dist/{chunk-D4QH6L54.js → chunk-XPZ7TMXH.js} +4 -4
- package/dist/{chunk-D4QH6L54.js.map → chunk-XPZ7TMXH.js.map} +1 -1
- package/dist/{chunk-BA36SQY2.js → chunk-YYSHQPCG.js} +3 -3
- package/dist/{chunk-BA36SQY2.js.map → chunk-YYSHQPCG.js.map} +1 -1
- package/dist/{chunk-LHLRG2BE.js → chunk-Z4LG3CZ4.js} +8 -5
- package/dist/chunk-Z4LG3CZ4.js.map +1 -0
- package/dist/{chunk-Y3AWLHQP.js → chunk-ZECZ2MKX.js} +730 -143
- package/dist/chunk-ZECZ2MKX.js.map +1 -0
- package/dist/compiler.cjs +5 -5
- package/dist/compiler.cjs.map +1 -1
- package/dist/compiler.d.cts +10 -10
- package/dist/compiler.d.ts +10 -10
- package/dist/compiler.js +5 -5
- package/dist/compiler.js.map +1 -1
- package/dist/contracts/handlers/index.cjs +11 -11
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/contracts/handlers/index.js +3 -3
- package/dist/{index-BQwrHcOh.d.cts → index-Bi22mLsh.d.cts} +212 -43
- package/dist/{index-BapVvuoI.d.ts → index-CiLMmCHX.d.ts} +2 -2
- package/dist/{index-DuXylQrN.d.ts → index-DOdoDqvM.d.ts} +212 -43
- package/dist/{index-BaTItxPx.d.cts → index-DnKugm-h.d.cts} +2 -2
- package/dist/index.cjs +327 -327
- package/dist/index.d.cts +149 -114
- package/dist/index.d.ts +149 -114
- package/dist/index.js +5 -5
- package/dist/{program-DPzf5qsk.d.cts → program-ZWUAWy_9.d.cts} +1 -1
- package/dist/{program-38A2Twvj.d.ts → program-zdDO4cMt.d.ts} +1 -1
- package/dist/repositories/realm/index.cjs +38 -38
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/realm/index.js +6 -6
- package/dist/repositories/sqlite/index.cjs +36 -36
- package/dist/repositories/sqlite/index.d.cts +2 -2
- package/dist/repositories/sqlite/index.d.ts +2 -2
- package/dist/repositories/sqlite/index.js +6 -6
- package/dist/{taskRunner-BxOmg-O6.d.ts → taskRunner-CoE4Xx9K.d.ts} +1 -1
- package/dist/{taskRunner-D2itCXf6.d.cts → taskRunner-DFG0BN_R.d.cts} +1 -1
- package/dist/wallet/expo/background.cjs +15 -15
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +7 -7
- package/dist/wallet/expo/index.cjs +19 -16
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +3 -2
- package/dist/wallet/expo/index.d.ts +3 -2
- package/dist/wallet/expo/index.js +9 -6
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/worker/expo/index.cjs +10 -10
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +6 -6
- package/package.json +3 -3
- package/dist/chunk-6WPP4UGN.cjs.map +0 -1
- package/dist/chunk-ACIQZLWL.cjs.map +0 -1
- package/dist/chunk-HS7TKVOZ.cjs.map +0 -1
- package/dist/chunk-LHLRG2BE.js.map +0 -1
- package/dist/chunk-QSERJPTT.js.map +0 -1
- package/dist/chunk-TD4PKK2I.cjs.map +0 -1
- package/dist/chunk-X57WKONW.js.map +0 -1
- package/dist/chunk-Y3AWLHQP.js.map +0 -1
package/dist/compiler.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkUNLH3NNG_cjs = require('./chunk-UNLH3NNG.cjs');
|
|
4
4
|
require('./chunk-6TBTL42M.cjs');
|
|
5
5
|
|
|
6
6
|
// src/compiler.ts
|
|
@@ -31,14 +31,14 @@ async function compile(input, options) {
|
|
|
31
31
|
}
|
|
32
32
|
throw error;
|
|
33
33
|
}
|
|
34
|
-
const {
|
|
34
|
+
const { contracts, ...compilerOptions } = options ?? {};
|
|
35
35
|
const result = await compiler.compile(input, compilerOptions);
|
|
36
36
|
if (result.artifact === null) throw new CompileError(result.diagnostics);
|
|
37
|
-
const
|
|
37
|
+
const debug = result.debug ?? void 0;
|
|
38
38
|
return {
|
|
39
|
-
program:
|
|
39
|
+
program: chunkUNLH3NNG_cjs.programFromArtifact(result.artifact, { debug, contracts }),
|
|
40
40
|
artifact: result.artifact,
|
|
41
|
-
...
|
|
41
|
+
...debug ? { debug } : {},
|
|
42
42
|
diagnostics: result.diagnostics
|
|
43
43
|
};
|
|
44
44
|
}
|
package/dist/compiler.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/compiler.ts"],"names":["programFromArtifact"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"sources":["../src/compiler.ts"],"names":["programFromArtifact"],"mappings":";;;;;;AA+BO,IAAM,YAAA,GAAN,cAA2B,KAAA,CAAM;AAAA,EAEpC,YAAqB,WAAA,EAA2B;AAC5C,IAAA,KAAA;AAAA,MACI,YACK,MAAA,CAAO,CAAC,MAAM,CAAA,CAAE,QAAA,KAAa,OAAO,CAAA,CACpC,GAAA;AAAA,QACG,CAAC,MACG,CAAA,EAAG,CAAA,CAAE,IAAI,CAAA,EAAG,CAAA,CAAE,QAAQ,CAAA,CAAA,EAAI,CAAA,CAAE,MAAM,IAAI,CAAA,CAAA,EAAI,EAAE,KAAA,CAAM,MAAM,KAAK,EAAE,CAAA,EAAA,EAAK,EAAE,OAAO,CAAA;AAAA,OACrF,CACC,IAAA,CAAK,IAAI,CAAA,IAAK;AAAA,KACvB;AATiB,I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AO;AAAA,GACxB;AACJ","file":"compiler.cjs","sourcesContent":["/**\n * Compile Arkade source into an SDK {@link Program}. Needs the optional peer\n * `@arkade-os/compiler`, which is loaded on the first {@link compile} call.\n *\n * @module compiler\n */\n\nimport type {\n CompileInput,\n CompileOptions,\n CompilerArtifact,\n DebugInfo,\n Diagnostic,\n} from \"@arkade-os/compiler\";\n\nimport { programFromArtifact, type ProgramFromArtifactOptions } from \"./arkade/artifact\";\nimport type { Program } from \"./arkade/program\";\n\nexport type { CompileInput, CompileOptions, CompilerArtifact, DebugInfo, Diagnostic };\n\nexport interface CompileOutput {\n program: Program;\n /** The compiler's artifact, carrying the source bundle, compiler version and fingerprint. */\n artifact: CompilerArtifact;\n /** The debug file: each covenant's source map. Absent with `debug: false`. */\n debug?: DebugInfo;\n /** Warnings; errors reject with {@link CompileError}. */\n diagnostics: Diagnostic[];\n}\n\n/** The source did not compile. `diagnostics` lists every error and warning. */\nexport class CompileError extends Error {\n override readonly name = \"CompileError\";\n constructor(readonly diagnostics: Diagnostic[]) {\n super(\n diagnostics\n .filter((d) => d.severity === \"error\")\n .map(\n (d) =>\n `${d.file}${d.start ? `:${d.start.line}:${d.start.column}` : \"\"}: ${d.message}`,\n )\n .join(\"\\n\") || \"compilation failed\",\n );\n }\n}\n\nconst PEER = \"@arkade-os/compiler\";\n\n/**\n * Compile `input.entry` and its relative imports from `input.files` into a {@link Program}.\n * `contracts` takes the artifacts of the contracts it instantiates, as `programFromArtifact` does.\n */\nexport async function compile(\n input: CompileInput,\n options?: CompileOptions & Pick<ProgramFromArtifactOptions, \"contracts\">,\n): Promise<CompileOutput> {\n let compiler: typeof import(\"@arkade-os/compiler\");\n try {\n compiler = await import(\"@arkade-os/compiler\");\n } catch (error) {\n // Only a missing peer gets the install hint; anything else keeps its own error.\n const code = (error as { code?: unknown } | null)?.code;\n if (\n (code === \"ERR_MODULE_NOT_FOUND\" || code === \"MODULE_NOT_FOUND\") &&\n String((error as Error).message).includes(`'${PEER}'`)\n ) {\n throw new Error(\n `@arkade-os/sdk/compiler needs the optional peer ${PEER}: npm install --save-exact ${PEER}`,\n { cause: error },\n );\n }\n throw error;\n }\n const { contracts, ...compilerOptions } = options ?? {};\n const result = await compiler.compile(input, compilerOptions);\n if (result.artifact === null) throw new CompileError(result.diagnostics);\n const debug = result.debug ?? undefined;\n return {\n program: programFromArtifact(result.artifact, { debug, contracts }),\n artifact: result.artifact,\n ...(debug ? { debug } : {}),\n diagnostics: result.diagnostics,\n };\n}\n"]}
|
package/dist/compiler.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Diagnostic,
|
|
2
|
-
export { CompileInput, CompilerArtifact, DebugInfo, Diagnostic } from '@arkade-os/compiler';
|
|
3
|
-
import { P as
|
|
1
|
+
import { Diagnostic, CompilerArtifact, DebugInfo, CompileInput, CompileOptions } from '@arkade-os/compiler';
|
|
2
|
+
export { CompileInput, CompileOptions, CompilerArtifact, DebugInfo, Diagnostic } from '@arkade-os/compiler';
|
|
3
|
+
import { P as ProgramFromArtifactOptions } from './artifact-DA5YHM2k.cjs';
|
|
4
|
+
import { P as Program } from './program-ZWUAWy_9.cjs';
|
|
4
5
|
import './base-C-Y5t_0F.cjs';
|
|
5
6
|
import '@scure/btc-signer';
|
|
6
7
|
import '@scure/btc-signer/psbt.js';
|
|
@@ -13,10 +14,6 @@ import '@scure/btc-signer/utils.js';
|
|
|
13
14
|
* @module compiler
|
|
14
15
|
*/
|
|
15
16
|
|
|
16
|
-
interface CompileOptions extends CompileOptions$1 {
|
|
17
|
-
/** Return the debug file and put its source maps on `program`. Defaults to `true`. */
|
|
18
|
-
debug?: boolean;
|
|
19
|
-
}
|
|
20
17
|
interface CompileOutput {
|
|
21
18
|
program: Program;
|
|
22
19
|
/** The compiler's artifact, carrying the source bundle, compiler version and fingerprint. */
|
|
@@ -32,7 +29,10 @@ declare class CompileError extends Error {
|
|
|
32
29
|
readonly name = "CompileError";
|
|
33
30
|
constructor(diagnostics: Diagnostic[]);
|
|
34
31
|
}
|
|
35
|
-
/**
|
|
36
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Compile `input.entry` and its relative imports from `input.files` into a {@link Program}.
|
|
34
|
+
* `contracts` takes the artifacts of the contracts it instantiates, as `programFromArtifact` does.
|
|
35
|
+
*/
|
|
36
|
+
declare function compile(input: CompileInput, options?: CompileOptions & Pick<ProgramFromArtifactOptions, "contracts">): Promise<CompileOutput>;
|
|
37
37
|
|
|
38
|
-
export { CompileError, type
|
|
38
|
+
export { CompileError, type CompileOutput, compile };
|
package/dist/compiler.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Diagnostic,
|
|
2
|
-
export { CompileInput, CompilerArtifact, DebugInfo, Diagnostic } from '@arkade-os/compiler';
|
|
3
|
-
import { P as
|
|
1
|
+
import { Diagnostic, CompilerArtifact, DebugInfo, CompileInput, CompileOptions } from '@arkade-os/compiler';
|
|
2
|
+
export { CompileInput, CompileOptions, CompilerArtifact, DebugInfo, Diagnostic } from '@arkade-os/compiler';
|
|
3
|
+
import { P as ProgramFromArtifactOptions } from './artifact-DacurepK.js';
|
|
4
|
+
import { P as Program } from './program-zdDO4cMt.js';
|
|
4
5
|
import './base-C-Y5t_0F.js';
|
|
5
6
|
import '@scure/btc-signer';
|
|
6
7
|
import '@scure/btc-signer/psbt.js';
|
|
@@ -13,10 +14,6 @@ import '@scure/btc-signer/utils.js';
|
|
|
13
14
|
* @module compiler
|
|
14
15
|
*/
|
|
15
16
|
|
|
16
|
-
interface CompileOptions extends CompileOptions$1 {
|
|
17
|
-
/** Return the debug file and put its source maps on `program`. Defaults to `true`. */
|
|
18
|
-
debug?: boolean;
|
|
19
|
-
}
|
|
20
17
|
interface CompileOutput {
|
|
21
18
|
program: Program;
|
|
22
19
|
/** The compiler's artifact, carrying the source bundle, compiler version and fingerprint. */
|
|
@@ -32,7 +29,10 @@ declare class CompileError extends Error {
|
|
|
32
29
|
readonly name = "CompileError";
|
|
33
30
|
constructor(diagnostics: Diagnostic[]);
|
|
34
31
|
}
|
|
35
|
-
/**
|
|
36
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Compile `input.entry` and its relative imports from `input.files` into a {@link Program}.
|
|
34
|
+
* `contracts` takes the artifacts of the contracts it instantiates, as `programFromArtifact` does.
|
|
35
|
+
*/
|
|
36
|
+
declare function compile(input: CompileInput, options?: CompileOptions & Pick<ProgramFromArtifactOptions, "contracts">): Promise<CompileOutput>;
|
|
37
37
|
|
|
38
|
-
export { CompileError, type
|
|
38
|
+
export { CompileError, type CompileOutput, compile };
|
package/dist/compiler.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { programFromArtifact } from './chunk-
|
|
1
|
+
import { programFromArtifact } from './chunk-43APGKWL.js';
|
|
2
2
|
import './chunk-GB67AGXG.js';
|
|
3
3
|
|
|
4
4
|
// src/compiler.ts
|
|
@@ -29,14 +29,14 @@ async function compile(input, options) {
|
|
|
29
29
|
}
|
|
30
30
|
throw error;
|
|
31
31
|
}
|
|
32
|
-
const {
|
|
32
|
+
const { contracts, ...compilerOptions } = options ?? {};
|
|
33
33
|
const result = await compiler.compile(input, compilerOptions);
|
|
34
34
|
if (result.artifact === null) throw new CompileError(result.diagnostics);
|
|
35
|
-
const
|
|
35
|
+
const debug = result.debug ?? void 0;
|
|
36
36
|
return {
|
|
37
|
-
program: programFromArtifact(result.artifact,
|
|
37
|
+
program: programFromArtifact(result.artifact, { debug, contracts }),
|
|
38
38
|
artifact: result.artifact,
|
|
39
|
-
...
|
|
39
|
+
...debug ? { debug } : {},
|
|
40
40
|
diagnostics: result.diagnostics
|
|
41
41
|
};
|
|
42
42
|
}
|
package/dist/compiler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/compiler.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"sources":["../src/compiler.ts"],"names":[],"mappings":";;;;AA+BO,IAAM,YAAA,GAAN,cAA2B,KAAA,C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A,MAAM,MAAA,GAAS,MAAM,QAAA,CAAS,OAAA,CAAQ,OAAO,eAAe,CAAA;AAC5D,EAAA,IAAI,OAAO,QAAA,KAAa,IAAA,QAAY,IAAI,YAAA,CAAa,OAAO,WAAW,CAAA;AACvE,EAAA,MAAM,KAAA,GAAQ,OAAO,KAAA,IAAS,MAAA;AAC9B,EAAA,OAAO;AAAA,IACH,SAAS,mBAAA,CAAoB,MAAA,CAAO,UAAU,EAAE,KAAA,EAAO,WAAW,CAAA;AAAA,IAClE,UAAU,MAAA,CAAO,QAAA;AAAA,IACjB,GAAI,KAAA,GAAQ,EAAE,KAAA,KAAU,EAAC;AAAA,IACzB,aAAa,MAAA,CAAO;AAAA,GACxB;AACJ","file":"compiler.js","sourcesContent":["/**\n * Compile Arkade source into an SDK {@link Program}. Needs the optional peer\n * `@arkade-os/compiler`, which is loaded on the first {@link compile} call.\n *\n * @module compiler\n */\n\nimport type {\n CompileInput,\n CompileOptions,\n CompilerArtifact,\n DebugInfo,\n Diagnostic,\n} from \"@arkade-os/compiler\";\n\nimport { programFromArtifact, type ProgramFromArtifactOptions } from \"./arkade/artifact\";\nimport type { Program } from \"./arkade/program\";\n\nexport type { CompileInput, CompileOptions, CompilerArtifact, DebugInfo, Diagnostic };\n\nexport interface CompileOutput {\n program: Program;\n /** The compiler's artifact, carrying the source bundle, compiler version and fingerprint. */\n artifact: CompilerArtifact;\n /** The debug file: each covenant's source map. Absent with `debug: false`. */\n debug?: DebugInfo;\n /** Warnings; errors reject with {@link CompileError}. */\n diagnostics: Diagnostic[];\n}\n\n/** The source did not compile. `diagnostics` lists every error and warning. */\nexport class CompileError extends Error {\n override readonly name = \"CompileError\";\n constructor(readonly diagnostics: Diagnostic[]) {\n super(\n diagnostics\n .filter((d) => d.severity === \"error\")\n .map(\n (d) =>\n `${d.file}${d.start ? `:${d.start.line}:${d.start.column}` : \"\"}: ${d.message}`,\n )\n .join(\"\\n\") || \"compilation failed\",\n );\n }\n}\n\nconst PEER = \"@arkade-os/compiler\";\n\n/**\n * Compile `input.entry` and its relative imports from `input.files` into a {@link Program}.\n * `contracts` takes the artifacts of the contracts it instantiates, as `programFromArtifact` does.\n */\nexport async function compile(\n input: CompileInput,\n options?: CompileOptions & Pick<ProgramFromArtifactOptions, \"contracts\">,\n): Promise<CompileOutput> {\n let compiler: typeof import(\"@arkade-os/compiler\");\n try {\n compiler = await import(\"@arkade-os/compiler\");\n } catch (error) {\n // Only a missing peer gets the install hint; anything else keeps its own error.\n const code = (error as { code?: unknown } | null)?.code;\n if (\n (code === \"ERR_MODULE_NOT_FOUND\" || code === \"MODULE_NOT_FOUND\") &&\n String((error as Error).message).includes(`'${PEER}'`)\n ) {\n throw new Error(\n `@arkade-os/sdk/compiler needs the optional peer ${PEER}: npm install --save-exact ${PEER}`,\n { cause: error },\n );\n }\n throw error;\n }\n const { contracts, ...compilerOptions } = options ?? {};\n const result = await compiler.compile(input, compilerOptions);\n if (result.artifact === null) throw new CompileError(result.diagnostics);\n const debug = result.debug ?? undefined;\n return {\n program: programFromArtifact(result.artifact, { debug, contracts }),\n artifact: result.artifact,\n ...(debug ? { debug } : {}),\n diagnostics: result.diagnostics,\n };\n}\n"]}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
3
|
+
var chunkVIQF74QJ_cjs = require('../../chunk-VIQF74QJ.cjs');
|
|
4
|
+
require('../../chunk-UNLH3NNG.cjs');
|
|
5
|
+
require('../../chunk-FKHUXSYW.cjs');
|
|
6
6
|
require('../../chunk-6TBTL42M.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "ArkadeContractHandler", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkVIQF74QJ_cjs.ArkadeContractHandler; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "BoardingContractHandler", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkVIQF74QJ_cjs.BoardingContractHandler; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "DefaultContractHandler", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkVIQF74QJ_cjs.DefaultContractHandler; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "DelegateContractHandler", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkVIQF74QJ_cjs.DelegateContractHandler; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "ExecutorContractHandler", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkVIQF74QJ_cjs.ExecutorContractHandler; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "VHTLCContractHandler", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkVIQF74QJ_cjs.VHTLCContractHandler; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "VHTLCV2ContractHandler", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunkVIQF74QJ_cjs.VHTLCV2ContractHandler; }
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "contractHandlers", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkVIQF74QJ_cjs.contractHandlers; }
|
|
41
41
|
});
|
|
42
42
|
//# sourceMappingURL=index.cjs.map
|
|
43
43
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from '../../index-
|
|
2
|
-
export {
|
|
1
|
+
export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from '../../index-DnKugm-h.cjs';
|
|
2
|
+
export { cr as ExecutorContractHandler, ct as ExecutorContractParams } from '../../index-Bi22mLsh.cjs';
|
|
3
3
|
import '../../base-C-Y5t_0F.cjs';
|
|
4
4
|
import '@scure/btc-signer';
|
|
5
5
|
import '@scure/btc-signer/psbt.js';
|
|
6
6
|
import '@scure/btc-signer/utils.js';
|
|
7
|
-
import '../../program-
|
|
7
|
+
import '../../program-ZWUAWy_9.cjs';
|
|
8
8
|
import '@scure/btc-signer/transaction.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from '../../index-
|
|
2
|
-
export {
|
|
1
|
+
export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from '../../index-CiLMmCHX.js';
|
|
2
|
+
export { cr as ExecutorContractHandler, ct as ExecutorContractParams } from '../../index-DOdoDqvM.js';
|
|
3
3
|
import '../../base-C-Y5t_0F.js';
|
|
4
4
|
import '@scure/btc-signer';
|
|
5
5
|
import '@scure/btc-signer/psbt.js';
|
|
6
6
|
import '@scure/btc-signer/utils.js';
|
|
7
|
-
import '../../program-
|
|
7
|
+
import '../../program-zdDO4cMt.js';
|
|
8
8
|
import '@scure/btc-signer/transaction.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ArkadeContractHandler, BoardingContractHandler, DefaultContractHandler, DelegateContractHandler, ExecutorContractHandler, VHTLCContractHandler, VHTLCV2ContractHandler, contractHandlers } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
1
|
+
export { ArkadeContractHandler, BoardingContractHandler, DefaultContractHandler, DelegateContractHandler, ExecutorContractHandler, VHTLCContractHandler, VHTLCV2ContractHandler, contractHandlers } from '../../chunk-R37I633T.js';
|
|
2
|
+
import '../../chunk-43APGKWL.js';
|
|
3
|
+
import '../../chunk-Z4LG3CZ4.js';
|
|
4
4
|
import '../../chunk-GB67AGXG.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
6
6
|
//# sourceMappingURL=index.js.map
|