@arkade-os/sdk 0.5.6 → 0.5.8
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 +2 -2
- 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/{asyncStorageTaskQueue-Bh2n0msM.d.cts → asyncStorageTaskQueue-B5NPtkXo.d.cts} +1 -1
- package/dist/{asyncStorageTaskQueue-CpkstKZ5.d.ts → asyncStorageTaskQueue-YPwiJyVA.d.ts} +1 -1
- package/dist/{chunk-47Z4LEIW.js → chunk-3F5AJ235.js} +4 -4
- package/dist/{chunk-47Z4LEIW.js.map → chunk-3F5AJ235.js.map} +1 -1
- package/dist/{chunk-HKEPJBTY.cjs → chunk-4IDCSOP2.cjs} +22 -16
- package/dist/chunk-4IDCSOP2.cjs.map +1 -0
- package/dist/{chunk-JFJNB7ZH.cjs → chunk-5PWL7WOT.cjs} +7 -5
- package/dist/chunk-5PWL7WOT.cjs.map +1 -0
- package/dist/{chunk-C7NY6WSA.js → chunk-E7LKKEVR.js} +10 -4
- package/dist/chunk-E7LKKEVR.js.map +1 -0
- package/dist/{chunk-Y3CDDPWI.cjs → chunk-EQ3JVVUR.cjs} +932 -558
- package/dist/chunk-EQ3JVVUR.cjs.map +1 -0
- package/dist/{chunk-DJYX73W2.js → chunk-F5O6JI2H.js} +8 -6
- package/dist/chunk-F5O6JI2H.js.map +1 -0
- package/dist/{chunk-VWW2ZBPI.js → chunk-H7GT3QC4.js} +4 -4
- package/dist/{chunk-VWW2ZBPI.js.map → chunk-H7GT3QC4.js.map} +1 -1
- package/dist/{chunk-4X67IB2V.cjs → chunk-JQSHFSME.cjs} +19 -17
- package/dist/chunk-JQSHFSME.cjs.map +1 -0
- package/dist/{chunk-NDQ4LB4X.cjs → chunk-JYQXB7OH.cjs} +19 -19
- package/dist/{chunk-NDQ4LB4X.cjs.map → chunk-JYQXB7OH.cjs.map} +1 -1
- package/dist/{chunk-YS76JSGP.cjs → chunk-KWR37J6L.cjs} +10 -10
- package/dist/{chunk-YS76JSGP.cjs.map → chunk-KWR37J6L.cjs.map} +1 -1
- package/dist/{chunk-X6ZI53DZ.cjs → chunk-L7OOPAUG.cjs} +14 -26
- package/dist/chunk-L7OOPAUG.cjs.map +1 -0
- package/dist/{chunk-YKT4NAQG.js → chunk-OLKZUJIN.js} +463 -95
- package/dist/chunk-OLKZUJIN.js.map +1 -0
- package/dist/{chunk-LZAINCGU.cjs → chunk-SOJDUKY6.cjs} +271 -225
- package/dist/chunk-SOJDUKY6.cjs.map +1 -0
- package/dist/{chunk-V3ZLL5VY.js → chunk-U34GU5RM.js} +9 -21
- package/dist/chunk-U34GU5RM.js.map +1 -0
- package/dist/{chunk-DNFTHG73.js → chunk-XXNPX4MK.js} +7 -5
- package/dist/chunk-XXNPX4MK.js.map +1 -0
- package/dist/{chunk-QTMK34TP.js → chunk-YTOABP6J.js} +268 -226
- package/dist/chunk-YTOABP6J.js.map +1 -0
- package/dist/compiler.cjs +3 -3
- package/dist/compiler.d.cts +1 -1
- package/dist/compiler.d.ts +1 -1
- package/dist/compiler.js +2 -2
- package/dist/contracts/handlers/index.cjs +10 -10
- 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-46g577Ka.d.cts → index-CKzBYoDa.d.cts} +2 -2
- package/dist/{index-2wKMrT0a.d.ts → index-COs69e8T.d.ts} +2 -2
- package/dist/{index-C66rjxz2.d.ts → index-Pk3i_MMU.d.ts} +13 -3
- package/dist/{index-Dqk07NwJ.d.cts → index-czozpKPT.d.cts} +13 -3
- package/dist/index.cjs +343 -315
- package/dist/index.d.cts +118 -138
- package/dist/index.d.ts +118 -138
- package/dist/index.js +6 -6
- package/dist/{keyringDescriptorProvider-DiBM4GmB.d.ts → keyringDescriptorProvider-CbNzWwbS.d.ts} +163 -2
- package/dist/{keyringDescriptorProvider-DnaLUC7v.d.cts → keyringDescriptorProvider-nC8fIjBN.d.cts} +163 -2
- package/dist/{program-BARSNg3X.d.ts → program-38A2Twvj.d.ts} +4 -2
- package/dist/{program-znrWkxE4.d.cts → program-DPzf5qsk.d.cts} +4 -2
- package/dist/repositories/realm/index.cjs +39 -39
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/realm/index.js +7 -7
- package/dist/repositories/sqlite/index.cjs +37 -37
- package/dist/repositories/sqlite/index.d.cts +2 -2
- package/dist/repositories/sqlite/index.d.ts +2 -2
- package/dist/repositories/sqlite/index.js +7 -7
- package/dist/{taskRunner-BM6IAKlS.d.ts → taskRunner-DBOqvP33.d.ts} +1 -1
- package/dist/{taskRunner-BmDIZiSl.d.cts → taskRunner-DXivOJHc.d.cts} +1 -1
- package/dist/wallet/expo/background.cjs +16 -16
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +8 -8
- package/dist/wallet/expo/index.cjs +17 -17
- package/dist/wallet/expo/index.d.cts +3 -3
- package/dist/wallet/expo/index.d.ts +3 -3
- package/dist/wallet/expo/index.js +7 -7
- package/dist/worker/expo/index.cjs +11 -11
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +7 -7
- package/package.json +2 -2
- package/dist/chunk-4X67IB2V.cjs.map +0 -1
- package/dist/chunk-C7NY6WSA.js.map +0 -1
- package/dist/chunk-DJYX73W2.js.map +0 -1
- package/dist/chunk-DNFTHG73.js.map +0 -1
- package/dist/chunk-HKEPJBTY.cjs.map +0 -1
- package/dist/chunk-JFJNB7ZH.cjs.map +0 -1
- package/dist/chunk-LZAINCGU.cjs.map +0 -1
- package/dist/chunk-QTMK34TP.js.map +0 -1
- package/dist/chunk-V3ZLL5VY.js.map +0 -1
- package/dist/chunk-X6ZI53DZ.cjs.map +0 -1
- package/dist/chunk-Y3CDDPWI.cjs.map +0 -1
- package/dist/chunk-YKT4NAQG.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { a as Identity,
|
|
2
|
-
export {
|
|
3
|
-
import { W as Wallet, R as ReadonlyWallet,
|
|
4
|
-
export {
|
|
5
|
-
import { T as TapLeafScript, E as EncodedVtxoScript, C as CSVMultisigTapscript, R as RelativeTimelock, V as VtxoScript
|
|
6
|
-
export { a as ArkTapscript, b as CLTVMultisigTapscript, c as ConditionCSVMultisigTapscript, d as ConditionMultisigTapscript, M as MultisigTapscript, e as TapTreeCoder, f as TapscriptType, g as decodeTapscript, h as getSequence, s as scriptFromTapLeafScript } from './base-C-Y5t_0F.cjs';
|
|
7
|
-
export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, V as VHTLC, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from './index-
|
|
8
|
-
|
|
9
|
-
export { a as DelegateVtxo } from './delegate-gGkUnYpi.cjs';
|
|
1
|
+
import { a as Identity, ah as DescriptorProvider, a3 as Transaction, a4 as SignerSession, a5 as ReadonlyIdentity, aF as DescriptorSigningRequest, aG as IntentFeeConfig, aH as OffchainInput, aI as FeeAmount, aJ as OnchainInput, aK as FeeOutput, Y as BatchRegistrationRepository, Z as BatchRegistration, _ as BatchRegistrationPageFilter, P as PageRequest, D as PageResult, B as Outpoint, $ as VirtualTxRepository, a0 as VirtualTx, a1 as VtxoBranch, W as WalletRepository, Q as AtomicWalletState, z as ExtendedVirtualCoin, F as ScriptVtxoCursor, H as ScriptVtxoPageOptions, J as StoredVtxo, K as VtxoRepositoryKey, E as ExtendedCoin, L as TransactionHistoryPageFilter, M as TransactionHistoryPageCursor, g as ArkTransaction, U as WalletState, y as Contract, w as IndexerProvider, aL as ArkadeInfo, aj as OnchainProvider, i as Activity, C as ContractRepository, X as ContractFilter, I as IWallet, x as OperatorProvider, as as NetworkName, ay as SettlementConfig, aM as ContractWatcherConfig, aN as Asset, R as Recipient, aO as FeeInfo, n as SettlementEvent, N as NormalizedExtendedVirtualCoin, S as SettleParams, G as GetOperatorInfoOptions, aP as GetVtxosOptions, aQ as PaginationOptions, e as GetVtxosFilter, f as GetSpendableVtxosFilter, aR as CreateContractParams, aS as GetContractsFilter, V as VirtualCoin, aT as GetSpendablePathsOptions, aU as GetAllSpendingPathsOptions, k as GetNewAddressesOptions, aV as InputExpiryFloor, aW as IssuanceParams, aX as ReissuanceParams, aY as BurnParams, aZ as RenewVtxosOptions, p as SendOnchainParams, O as OperatorInfo, a_ as NormalizedVtxoPage, A as ArkadeReader, c as ArkadeBroadcaster, d as WalletBalance, ap as ContractSyncState, at as ContractWithVtxos, a$ as WatchedScript, b0 as PathSelection, l as NewAddress, b1 as ContractEvent, b2 as AssetDetails, b3 as IssuanceResult, b4 as DelegateInfo, b5 as MigrationGlobalSkipReason, b6 as MigrationLegSkipReason, b7 as SignerStatus, ai as IReadonlyWallet, h as ActivityRegistry, ao as IReadonlyAssetManager, b8 as StorageConfig, j as IContractManager, q as IAssetManager, o as SendParams, m as IDelegateManager, b9 as IVtxoManager, a6 as Network, av as Coin, ba as SendBitcoinParams, bb as ExplorerTransaction, aC as SignedProof, aD as Proof, bc as TreeNonces, bd as TreePartialSigs, T as TxNotificationEvent, be as PendingTx, bf as EmulatorProvider, bg as Status, bh as ChainTx, aa as TxTree, bi as ArkadeService, bj as ContractVtxoEvent, bk as ExtendedContractVtxo, bl as ResolvedArkadeService, bm as resolveArkadeService, bn as PathContext } from './index-czozpKPT.cjs';
|
|
2
|
+
export { bo as ActivityIntent, a7 as ActivityResolver, bp as ArkIntent, bq as ArkIntentState, v as ArkProvider, br as AssetMetadata, bs as BATCH_REGISTRATION_TERMINAL_STATES, bt as BITCOIN_EMULATOR_PUBKEY, bu as BaseWalletConfig, ae as BatchFailedEvent, ac as BatchFinalizationEvent, ad as BatchFinalizedEvent, bv as BatchInfo, bw as BatchRegistrationFilter, bx as BatchRegistrationState, by as BatchSignableIdentity, a8 as BatchStartedEvent, bz as CandidateDeps, bA as ChainTxType, a2 as ChainedTxType, bB as CommitmentTx, bC as ConnectorTreeNode, bD as ContractBalance, bE as ContractEventCallback, bF as ContractHandler, aw as ContractManager, ax as ContractManagerConfig, bG as ContractScope, bH as ContractState, bI as ContractVtxo, bJ as ContractWatcher, bK as ContractWatcherEventCallback, bL as DEFAULT_ARKADE_EMULATOR_URL, bM as DEFAULT_VTXO_PAGE_SIZE, bN as DelegateManagerImpl, bO as DelegateOptions, ak as DelegateProvider, bP as DeprecatedSignerMigrationReport, bQ as DeprecatedSignerReport, bR as DigestMismatchError, bS as Discoverable, bT as DiscoveredContract, bU as DiscoveryDeps, bV as ESPLORA_URL, bW as EmulatorInfo, ar as EsploraProvider, bX as EventSourceCapable, bY as EventSourceFactory, bZ as EventSourceLike, b_ as EventSourceUnavailableError, am as ExitCaptureMode, b$ as ExitChainResolver, an as ExitDataSource, c0 as GetArkadeInfoOptions, c1 as GetUtxosOptions, c2 as GroupMembership, c3 as HandlerError, c4 as INTENT_TERMINAL_STATES, c5 as IndexerTxType, c6 as IndexerUtxo, c7 as IndexerUtxosUnsupportedError, aB as Intent, c8 as IntentCoin, c9 as IntentFilter, ca as IntentPageFilter, cb as IntentRepository, cc as KnownMetadata, cd as MAX_PAGE_SIZE, ce as MUTINYNET_EMULATOR_PUBKEY, cf as MigrateDeprecatedSignerOptions, cg as MigrationLegReport, ch as MigrationVtxoRef, ci as NewAddressType, cj as Nonces, ck as OnchainCosignAmbiguousError, cl as OnchainCosignRejectedError, cm as OnchainCosignUnsupportedError, cn as Output, co as PageResponse, cp as PartialSig, cq as PrevTxSource, cr as PrevTxUnavailableError, cs as ProofInput, ct as ProviderClass, cu as REGTEST_EMULATOR_PUBKEY, cv as RawTxSource, al as ReadonlyWalletConfig, aq as RecipientArkadeAddressContext, cw as RenewalSplit, cx as RenewalSplitContext, cy as RestArkProvider, cz as RestDelegateProvider, cA as RestEmulatorProvider, s as RestIndexerProvider, r as RestOperatorProvider, cB as ScanContractsOptions, cC as ScanResult, cD as ScheduledSession, cE as SettlementEventType, cF as SignRequest, aA as SignedIntent, cG as SignerClassification, cH as SignerSet, t as SubscriptionEvent, cI as SubscriptionFilter, u as SubscriptionHeartbeat, cJ as SubscriptionResponse, cK as SweepTxNotification, cL as TapLeaves, aE as TimeHeight, ab as TreeNoncesEvent, ag as TreeSignatureEvent, cM as TreeSignerSession, a9 as TreeSigningStartedEvent, af as TreeTxEvent, cN as Tx, cO as TxHistoryRecord, cP as TxKey, cQ as TxNotification, cR as TxTag, cS as TxTreeNode, cT as TxType, cU as Vtxo, cV as VtxoChain, az as VtxoManager, cW as VtxoType, b as WalletConfig, cX as WalletMode, cY as WithPrevTx, cZ as assertAllowedSighashTypes, c_ as assertPageRequest, c$ as assertRecipientArkadeAddress, d0 as assetMintResolver, d1 as attachPrevArkTxs, d2 as attachPrevoutTxs, d3 as boardingResolver, d4 as canRecoverOnchain, d5 as canSpendOffchain, d6 as canSweepOnchain, d7 as classifyAgainstSignerSet, d8 as classifyContractSigner, d9 as collabExitResolver, da as collectBatchRegistrations, db as collectContracts, dc as collectIntents, dd as collectPages, de as collectScriptVtxos, df as collectTransactionHistory, dg as collectUtxos, dh as collectVtxos, di as configureEventSource, dj as createDefaultActivityRegistry, dk as createExitChainResolver, dl as defaultEmulatorPubkey, dm as getAllNormalizedVtxos, dn as getConfiguredEventSource, dp as getNetwork, dq as getNormalizedVtxos, dr as getRandomId, ds as hasCandidates, dt as isBatchSignable, du as isContractVtxoEvent, dv as isCooperativelyMigratable, dw as isDiscoverable, dx as isEventSourceUnavailableError, dy as isPastExpiry, dz as isSigningIdentity, dA as isSubdust, dB as isTerminalBatchRegistrationState, dC as isTerminalIntentState, dD as isVirtualCoin, dE as isVtxoExpiringSoon, dF as isVtxoSpent, dG as iteratePages, dH as networkFromArkadeInfo, dI as networkFromOperatorInfo, dJ as networks, dK as pageResult, dL as resolveEmulatorPubkey, dM as resolveEventSource, dN as resolvePrevTxs, dO as signerSetFromInfo, dP as toOffchainInputFeeParams, dQ as toXOnlySignerHex, dR as withPrevTxs } from './index-czozpKPT.cjs';
|
|
3
|
+
import { b as ArkadeCashTx, c as ArkadeCashRecord, d as ArkadeCashClaimResult, W as Wallet, R as ReadonlyWallet, e as ReceiveRotatorFactory, f as ReceiveRotatorBootOpts, g as ReceiveRotatorBoot, P as ProviderConnectionState, H as HDWalletCapable, a as HDAllocationCapable, A as AddressAllocationCapable, B as BatchExpiryPolicy, h as Batch } from './keyringDescriptorProvider-nC8fIjBN.cjs';
|
|
4
|
+
export { i as AbortError, j as ArkError, k as ArkErrorName, l as ArkadeCash, m as ArkadeCashAction, n as ArkadeCashCreateError, o as ArkadeCashOperatorMismatchError, p as ArkadeCashUnclaimedReason, q as ArkadeCashUnclaimedVtxo, r as ArkadeCashVtxoRef, s as BoardingUtxoGroup, D as DEFAULT_MIN_BATCH_EXPIRY_SECONDS, F as ForeignDescriptorError, t as HttpResponseError, I as IncomingFunds, u as IndexedDBWalletRepository, K as KeyringDescriptorProvider, M as MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD, N as NotifiesIncomingFunds, v as ProviderKind, w as ProviderUnavailableError, x as REGTEST_MIN_BATCH_EXPIRY_SECONDS, y as ReadonlySingleKey, S as ServerInfoSource, z as ServerResponseMismatchError, C as SingleKey, V as VtxoReservation, E as VtxoReservedError, G as WaitForIncomingFundsOptions, J as WalletCannotAllocateAddressError, L as addArkadeCashRecord, O as arkadeCashId, Q as arkadeCashResolver, T as assertValidBatchExpiry, U as createArkadeCashTracker, X as defaultBatchExpiryPolicy, Y as isAddressAllocationCapable, Z as isArkError, _ as isHDAllocationCapable, $ as isHDWalletCapable, a0 as maybeArkError, a1 as mergeArkadeCashRecord, a2 as resolveBatchExpiryPolicy, a3 as resolveDescriptorSigner, a4 as selectVirtualCoins, a5 as signingDescriptorIndex, a6 as strictSigningDescriptorIndex, a7 as waitForIncomingFunds } from './keyringDescriptorProvider-nC8fIjBN.cjs';
|
|
5
|
+
import { T as TapLeafScript, E as EncodedVtxoScript, C as CSVMultisigTapscript, R as RelativeTimelock, V as VtxoScript } from './base-C-Y5t_0F.cjs';
|
|
6
|
+
export { A as ArkAddress, a as ArkTapscript, b as CLTVMultisigTapscript, c as ConditionCSVMultisigTapscript, d as ConditionMultisigTapscript, M as MultisigTapscript, e as TapTreeCoder, f as TapscriptType, g as decodeTapscript, h as getSequence, s as scriptFromTapLeafScript } from './base-C-Y5t_0F.cjs';
|
|
7
|
+
export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, V as VHTLC, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from './index-CKzBYoDa.cjs';
|
|
8
|
+
export { D as DefaultVtxo, a as DelegateVtxo } from './delegate-gGkUnYpi.cjs';
|
|
10
9
|
import { Bytes, BTC_NETWORK } from '@scure/btc-signer/utils.js';
|
|
11
10
|
import { Transaction as Transaction$1, OP, Script, ScriptType } from '@scure/btc-signer';
|
|
12
11
|
import { P2TR } from '@scure/btc-signer/payment.js';
|
|
13
12
|
import { ElectrumWS } from 'ws-electrumx-client';
|
|
14
13
|
import { TransactionOutput, TransactionInputUpdate } from '@scure/btc-signer/psbt.js';
|
|
15
14
|
import * as P from 'micro-packed';
|
|
16
|
-
import { P as Program, A as ArkadeArgValue, a as ArkadeProgramScript, b as ProgramKeys, c as ArkadeParamValue, d as ArkadeFunction, I as InputDef, e as ArkadeValueType, C as CompiledProgramFunction, S as SourceRange, f as ArkadeArgType, g as ArkadeContractParams, h as ArkadeSegment, i as AsmToken, j as InputRef, k as SUPPORTED_PROGRAM_VERSION, l as SignerRef, T as TapscriptSegment, m as TweakedSigner, U as UnsupportedProgramVersionError, W as WitnessRef, n as deserializeArkadeContractParams, p as parseArtifact, r as resolveAsm, s as serializeArkadeContractParams, o as stringifyArtifact, v as validateProgram, w as witnessRefToBytes } from './program-
|
|
15
|
+
import { P as Program, A as ArkadeArgValue, a as ArkadeProgramScript, b as ProgramKeys, c as ArkadeParamValue, d as ArkadeFunction, I as InputDef, e as ArkadeValueType, C as CompiledProgramFunction, S as SourceRange, f as ArkadeArgType, g as ArkadeContractParams, h as ArkadeSegment, i as AsmToken, j as InputRef, k as SUPPORTED_PROGRAM_VERSION, l as SignerRef, T as TapscriptSegment, m as TweakedSigner, U as UnsupportedProgramVersionError, W as WitnessRef, n as deserializeArkadeContractParams, p as parseArtifact, r as resolveAsm, s as serializeArkadeContractParams, o as stringifyArtifact, v as validateProgram, w as witnessRefToBytes } from './program-DPzf5qsk.cjs';
|
|
17
16
|
import '@scure/btc-signer/transaction.js';
|
|
18
17
|
|
|
19
18
|
/** Validate an optional millisecond duration; zero retains its caller-defined meaning. */
|
|
@@ -26,11 +25,18 @@ interface WebAuthnClient {
|
|
|
26
25
|
create(options: CredentialCreationOptions): Promise<Credential | null>;
|
|
27
26
|
get(options: CredentialRequestOptions): Promise<Credential | null>;
|
|
28
27
|
}
|
|
28
|
+
/** Only `"unsupported"` (PRF reported off when the passkey was made, or no WebAuthn) means a passkey never gives
|
|
29
|
+
* a key; after the others it may still give one elsewhere, so a fallback tied to it can meet another wallet. */
|
|
30
|
+
type PrfUnavailableReason = "unsupported" | "unknown" | "no-secret" | "secret-changed" | "malformed" | "unconfirmed";
|
|
29
31
|
/** The browser or the authenticator cannot return a PRF secret, so this passkey cannot derive a key. */
|
|
30
32
|
declare class PrfUnavailable extends Error {
|
|
31
33
|
name: string;
|
|
32
|
-
/** Set when the passkey was created before this failure
|
|
34
|
+
/** Set when the passkey was created before this failure; check `reason` before using it some other way. */
|
|
33
35
|
credentialId?: Uint8Array;
|
|
36
|
+
readonly reason?: PrfUnavailableReason;
|
|
37
|
+
constructor(message?: string, options?: ErrorOptions & {
|
|
38
|
+
reason?: PrfUnavailableReason;
|
|
39
|
+
});
|
|
34
40
|
}
|
|
35
41
|
/** The user dismissed the passkey prompt. */
|
|
36
42
|
declare class PasskeyCancelled extends Error {
|
|
@@ -43,6 +49,7 @@ declare class PasskeyCancelled extends Error {
|
|
|
43
49
|
*/
|
|
44
50
|
declare class PasskeyUnconfirmed extends PrfUnavailable {
|
|
45
51
|
name: string;
|
|
52
|
+
readonly reason = "unconfirmed";
|
|
46
53
|
}
|
|
47
54
|
/** The label of a passkey's first wallet, as in Breez's seedless-restore implementation. */
|
|
48
55
|
declare const DEFAULT_PASSKEY_LABEL = "Default";
|
|
@@ -54,7 +61,7 @@ declare function prfSupport(): Promise<"yes" | "no" | "unknown">;
|
|
|
54
61
|
* creation returns no PRF result there is nothing to compare that use against, so an authenticator
|
|
55
62
|
* that changes its secret later is not caught here; it derives other words on the next sign-in.
|
|
56
63
|
*
|
|
57
|
-
* @throws PrfUnavailable when the authenticator cannot do PRF or gives another secret on reuse
|
|
64
|
+
* @throws PrfUnavailable when the authenticator cannot do PRF or gives another secret on reuse; `reason` says which
|
|
58
65
|
* @throws PasskeyUnconfirmed when the passkey fails its first use right after creation, for any
|
|
59
66
|
* reason (`cause` holds the error); this and PrfUnavailable carry the new passkey's
|
|
60
67
|
* `credentialId`, since the passkey exists by then
|
|
@@ -94,76 +101,6 @@ declare function evaluatePrf(o: {
|
|
|
94
101
|
*/
|
|
95
102
|
declare const mnemonicFromPrf: (prfSecret: Uint8Array, words?: 12 | 24) => string;
|
|
96
103
|
|
|
97
|
-
/**
|
|
98
|
-
* In-memory single key implementation for Bitcoin transaction signing.
|
|
99
|
-
*
|
|
100
|
-
* @example
|
|
101
|
-
* ```typescript
|
|
102
|
-
* // Create from hex string
|
|
103
|
-
* const key = SingleKey.fromHex('your_private_key_hex');
|
|
104
|
-
*
|
|
105
|
-
* // Create from raw bytes
|
|
106
|
-
* const key = SingleKey.fromPrivateKey(privateKeyBytes);
|
|
107
|
-
*
|
|
108
|
-
* // Create random key
|
|
109
|
-
* const randomKey = SingleKey.fromRandomBytes();
|
|
110
|
-
*
|
|
111
|
-
* // Sign a transaction
|
|
112
|
-
* const signedTx = await key.sign(transaction);
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
declare class SingleKey implements Identity {
|
|
116
|
-
private key;
|
|
117
|
-
private constructor();
|
|
118
|
-
/** Create a signing identity from raw private key bytes. */
|
|
119
|
-
static fromPrivateKey(privateKey: Uint8Array): SingleKey;
|
|
120
|
-
/** Create a signing identity from a hex-encoded private key. */
|
|
121
|
-
static fromHex(privateKeyHex: string): SingleKey;
|
|
122
|
-
/** Create a signing identity with a freshly generated random private key. */
|
|
123
|
-
static fromRandomBytes(): SingleKey;
|
|
124
|
-
/**
|
|
125
|
-
* Export the private key as a hex string.
|
|
126
|
-
*
|
|
127
|
-
* @returns The private key as a hex string
|
|
128
|
-
*/
|
|
129
|
-
toHex(): string;
|
|
130
|
-
sign(tx: Transaction, inputIndexes?: number[]): Promise<Transaction>;
|
|
131
|
-
compressedPublicKey(): Promise<Uint8Array>;
|
|
132
|
-
xOnlyPublicKey(): Promise<Uint8Array>;
|
|
133
|
-
signerSession(): SignerSession;
|
|
134
|
-
signMessage(message: Uint8Array, signatureType?: "schnorr" | "ecdsa"): Promise<Uint8Array>;
|
|
135
|
-
/**
|
|
136
|
-
* BIP-340 sign `messageHash` with aux_rand = 0, so the signature — and
|
|
137
|
-
* anything derived from it — is reproducible from the key alone.
|
|
138
|
-
*
|
|
139
|
-
* What lets a static wallet derive a swap preimage instead of storing one
|
|
140
|
-
* (see `wallet/contractSecrets.ts`). Deliberately NOT `signMessage`, whose
|
|
141
|
-
* schnorr branch draws a random aux_rand: a preimage derived from that is
|
|
142
|
-
* unrecoverable, and the loss would only surface at claim time.
|
|
143
|
-
*/
|
|
144
|
-
signSchnorrDeterministic(messageHash: Uint8Array): Promise<Uint8Array>;
|
|
145
|
-
toReadonly(): Promise<ReadonlySingleKey>;
|
|
146
|
-
}
|
|
147
|
-
declare class ReadonlySingleKey implements ReadonlyIdentity {
|
|
148
|
-
private readonly publicKey;
|
|
149
|
-
/** Create a readonly identity from a compressed public key. */
|
|
150
|
-
constructor(publicKey: Uint8Array);
|
|
151
|
-
/**
|
|
152
|
-
* Create a ReadonlySingleKey from a compressed public key.
|
|
153
|
-
*
|
|
154
|
-
* @param publicKey - 33-byte compressed public key (02/03 prefix + 32-byte x coordinate)
|
|
155
|
-
* @returns A new ReadonlySingleKey instance
|
|
156
|
-
* @example
|
|
157
|
-
* ```typescript
|
|
158
|
-
* const pubkey = new Uint8Array(33); // your compressed public key
|
|
159
|
-
* const readonlyKey = ReadonlySingleKey.fromPublicKey(pubkey);
|
|
160
|
-
* ```
|
|
161
|
-
*/
|
|
162
|
-
static fromPublicKey(publicKey: Uint8Array): ReadonlySingleKey;
|
|
163
|
-
xOnlyPublicKey(): Promise<Uint8Array>;
|
|
164
|
-
compressedPublicKey(): Promise<Uint8Array>;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
104
|
/**
|
|
168
105
|
* Normalize a value to descriptor format.
|
|
169
106
|
* If already a descriptor, return as-is. If hex pubkey, wrap as tr(pubkey).
|
|
@@ -622,6 +559,54 @@ declare function contractFromArkContractWithAddress(encoded: string, serverPubKe
|
|
|
622
559
|
/** Check if a string is an arkcontract. */
|
|
623
560
|
declare function isArkContract(str: string): boolean;
|
|
624
561
|
|
|
562
|
+
type ArkadeCashStatus = "available" | "claimed" | "recovering" | "expired" | "exited" | "unissued";
|
|
563
|
+
interface ArkadeCashStatusReport {
|
|
564
|
+
status: ArkadeCashStatus;
|
|
565
|
+
amount: number;
|
|
566
|
+
/** Funding transactions, each with the voucher's own share of it. */
|
|
567
|
+
issues: ArkadeCashTx[];
|
|
568
|
+
/**
|
|
569
|
+
* Spending transactions, each with the voucher's own share of it (the coin's value, before
|
|
570
|
+
* any intent fee). A claim is the offchain tx that spent the coin or, for a coin settled in a
|
|
571
|
+
* batch, the commitment of that settlement.
|
|
572
|
+
*/
|
|
573
|
+
claims: ArkadeCashTx[];
|
|
574
|
+
}
|
|
575
|
+
declare function readArkadeCash(token: string, indexer: IndexerProvider, info: ArkadeInfo, onchain?: OnchainProvider): Promise<ArkadeCashStatusReport>;
|
|
576
|
+
|
|
577
|
+
type ArkadeCashRequest = {
|
|
578
|
+
action: "get";
|
|
579
|
+
token: string;
|
|
580
|
+
} | {
|
|
581
|
+
action: "create";
|
|
582
|
+
amount: number;
|
|
583
|
+
} | {
|
|
584
|
+
action: "claim";
|
|
585
|
+
token: string;
|
|
586
|
+
} | {
|
|
587
|
+
action: "reveal";
|
|
588
|
+
token: string;
|
|
589
|
+
} | {
|
|
590
|
+
action: "activities";
|
|
591
|
+
records: ArkadeCashRecord[];
|
|
592
|
+
};
|
|
593
|
+
type ArkadeCashResponse = ({
|
|
594
|
+
action: "get";
|
|
595
|
+
} & ArkadeCashStatusReport & {
|
|
596
|
+
cashId: string;
|
|
597
|
+
}) | {
|
|
598
|
+
action: "create";
|
|
599
|
+
token: string;
|
|
600
|
+
} | ({
|
|
601
|
+
action: "claim";
|
|
602
|
+
} & ArkadeCashClaimResult) | {
|
|
603
|
+
action: "reveal";
|
|
604
|
+
cashId: string;
|
|
605
|
+
} | {
|
|
606
|
+
action: "activities";
|
|
607
|
+
activities: Activity[];
|
|
608
|
+
};
|
|
609
|
+
|
|
625
610
|
/**
|
|
626
611
|
* Thrown when a descriptor-capable contract (default, delegate, or boarding)
|
|
627
612
|
* cannot be routed to any signer: its owner key (`params.pubKey`) is not this
|
|
@@ -2330,6 +2315,14 @@ type ResponseGetSpendableVtxos = ResponseEnvelope & {
|
|
|
2330
2315
|
type RequestGetBoardingUtxos = RequestEnvelope & {
|
|
2331
2316
|
type: "GET_BOARDING_UTXOS";
|
|
2332
2317
|
};
|
|
2318
|
+
type RequestArkadeCash = RequestEnvelope & {
|
|
2319
|
+
type: "ARKADE_CASH";
|
|
2320
|
+
payload: ArkadeCashRequest;
|
|
2321
|
+
};
|
|
2322
|
+
type ResponseArkadeCash = ResponseEnvelope & {
|
|
2323
|
+
type: "ARKADE_CASH";
|
|
2324
|
+
payload?: ArkadeCashResponse;
|
|
2325
|
+
};
|
|
2333
2326
|
type ResponseGetBoardingUtxos = ResponseEnvelope & {
|
|
2334
2327
|
type: "BOARDING_UTXOS";
|
|
2335
2328
|
payload: {
|
|
@@ -2960,8 +2953,8 @@ type RequestRestoreWallet = RequestEnvelope & {
|
|
|
2960
2953
|
type ResponseRestoreWallet = ResponseEnvelope & {
|
|
2961
2954
|
type: "RESTORE_WALLET_SUCCESS";
|
|
2962
2955
|
};
|
|
2963
|
-
type WalletUpdaterRequest = RequestInitWallet | RequestSettle | RequestGetAddress | RequestGetBoardingAddress | RequestGetOperatorInfo | RequestIndexerGetVtxos | RequestIndexerGetVirtualTxs | RequestSubmitTx | RequestFinalizeTx | RequestGetBalance | RequestGetVtxos | RequestGetSpendableVtxos | RequestGetBoardingUtxos | RequestGetTransactionHistory | RequestGetStatus | RequestGetContractSyncState | RequestClear | RequestReloadWallet | RequestSignTransaction | RequestCreateContract | RequestGetContracts | RequestGetContractsWithVtxos | RequestGetStoredContractsWithVtxos | RequestWatchScript | RequestUnwatchScript | RequestGetWatchedScripts | RequestAnnotateVtxos | RequestUpdateContract | RequestDeleteContract | RequestGetSpendablePaths | RequestGetAllSpendingPaths | RequestGetUnsupportedContracts | RequestIsContractManagerWatching | RequestRefreshVtxos | RequestRefreshOutpoints | RequestGetCurrentSigningDescriptor | RequestGetNextSigningDescriptor | RequestGetNewAddresses | RequestGetUsedSigningDescriptors | RequestAdvanceSigningDescriptorWatermark | RequestSend | RequestSendWithDeadline | RequestSendWithInputExpiryFloor | RequestGetAssetDetails | RequestIssue | RequestReissue | RequestBurn | RequestDelegate | RequestGetDelegateInfo | RequestRecoverVtxos | RequestGetRecoverableBalance | RequestGetExpiringVtxos | RequestRenewVtxos | RequestGetExpiredBoardingUtxos | RequestSweepExpiredBoardingUtxos | RequestCosignOnchainTx | RequestSendOnchain | RequestMigrateDeprecatedSignerVtxos | RequestGetDeprecatedSignerStatus | RequestRestoreWallet;
|
|
2964
|
-
type WalletUpdaterResponse = ResponseEnvelope & (ResponseInitWallet | ResponseSettle | ResponseSettleEvent | ResponseGetAddress | ResponseGetBoardingAddress | ResponseGetOperatorInfo | ResponseIndexerGetVtxos | ResponseIndexerGetVirtualTxs | ResponseSubmitTx | ResponseFinalizeTx | ResponseGetBalance | ResponseGetVtxos | ResponseGetSpendableVtxos | ResponseGetBoardingUtxos | ResponseGetTransactionHistory | ResponseGetStatus | ResponseGetContractSyncState | ResponseClear | ResponseReloadWallet | ResponseUtxoUpdate | ResponseVtxoUpdate | ResponseSignTransaction | ResponseCreateContract | ResponseGetContracts | ResponseGetContractsWithVtxos | ResponseGetStoredContractsWithVtxos | ResponseWatchScript | ResponseUnwatchScript | ResponseGetWatchedScripts | ResponseAnnotateVtxos | ResponseUpdateContract | ResponseContractWatchStateSet | ResponseDeleteContract | ResponseGetSpendablePaths | ResponseGetAllSpendingPaths | ResponseGetUnsupportedContracts | ResponseIsContractManagerWatching | ResponseRefreshVtxos | ResponseRefreshOutpoints | ResponseGetCurrentSigningDescriptor | ResponseGetNextSigningDescriptor | ResponseGetNewAddresses | ResponseGetUsedSigningDescriptors | ResponseAdvanceSigningDescriptorWatermark | ResponseContractEvent | ResponseSend | ResponseSendDeadlineExceeded | ResponseGetAssetDetails | ResponseIssue | ResponseReissue | ResponseBurn | ResponseDelegate | ResponseGetDelegateInfo | ResponseRecoverVtxos | ResponseRecoverVtxosEvent | ResponseGetRecoverableBalance | ResponseGetExpiringVtxos | ResponseRenewVtxos | ResponseRenewVtxosEvent | ResponseGetExpiredBoardingUtxos | ResponseSweepExpiredBoardingUtxos | ResponseCosignOnchainTx | ResponseSendOnchain | ResponseMigrateDeprecatedSignerVtxos | ResponseMigrateDeprecatedSignerVtxosEvent | ResponseGetDeprecatedSignerStatus | ResponseRestoreWallet);
|
|
2956
|
+
type WalletUpdaterRequest = RequestInitWallet | RequestSettle | RequestGetAddress | RequestGetBoardingAddress | RequestGetOperatorInfo | RequestIndexerGetVtxos | RequestIndexerGetVirtualTxs | RequestSubmitTx | RequestFinalizeTx | RequestGetBalance | RequestGetVtxos | RequestGetSpendableVtxos | RequestGetBoardingUtxos | RequestGetTransactionHistory | RequestGetStatus | RequestGetContractSyncState | RequestClear | RequestReloadWallet | RequestSignTransaction | RequestCreateContract | RequestGetContracts | RequestGetContractsWithVtxos | RequestGetStoredContractsWithVtxos | RequestWatchScript | RequestUnwatchScript | RequestGetWatchedScripts | RequestAnnotateVtxos | RequestUpdateContract | RequestDeleteContract | RequestGetSpendablePaths | RequestGetAllSpendingPaths | RequestGetUnsupportedContracts | RequestIsContractManagerWatching | RequestRefreshVtxos | RequestRefreshOutpoints | RequestGetCurrentSigningDescriptor | RequestGetNextSigningDescriptor | RequestGetNewAddresses | RequestGetUsedSigningDescriptors | RequestAdvanceSigningDescriptorWatermark | RequestSend | RequestSendWithDeadline | RequestSendWithInputExpiryFloor | RequestGetAssetDetails | RequestIssue | RequestReissue | RequestBurn | RequestDelegate | RequestGetDelegateInfo | RequestRecoverVtxos | RequestGetRecoverableBalance | RequestGetExpiringVtxos | RequestRenewVtxos | RequestGetExpiredBoardingUtxos | RequestSweepExpiredBoardingUtxos | RequestCosignOnchainTx | RequestSendOnchain | RequestMigrateDeprecatedSignerVtxos | RequestGetDeprecatedSignerStatus | RequestRestoreWallet | RequestArkadeCash;
|
|
2957
|
+
type WalletUpdaterResponse = ResponseEnvelope & (ResponseInitWallet | ResponseSettle | ResponseSettleEvent | ResponseGetAddress | ResponseGetBoardingAddress | ResponseGetOperatorInfo | ResponseIndexerGetVtxos | ResponseIndexerGetVirtualTxs | ResponseSubmitTx | ResponseFinalizeTx | ResponseGetBalance | ResponseGetVtxos | ResponseGetSpendableVtxos | ResponseGetBoardingUtxos | ResponseGetTransactionHistory | ResponseGetStatus | ResponseGetContractSyncState | ResponseClear | ResponseReloadWallet | ResponseUtxoUpdate | ResponseVtxoUpdate | ResponseSignTransaction | ResponseCreateContract | ResponseGetContracts | ResponseGetContractsWithVtxos | ResponseGetStoredContractsWithVtxos | ResponseWatchScript | ResponseUnwatchScript | ResponseGetWatchedScripts | ResponseAnnotateVtxos | ResponseUpdateContract | ResponseContractWatchStateSet | ResponseDeleteContract | ResponseGetSpendablePaths | ResponseGetAllSpendingPaths | ResponseGetUnsupportedContracts | ResponseIsContractManagerWatching | ResponseRefreshVtxos | ResponseRefreshOutpoints | ResponseGetCurrentSigningDescriptor | ResponseGetNextSigningDescriptor | ResponseGetNewAddresses | ResponseGetUsedSigningDescriptors | ResponseAdvanceSigningDescriptorWatermark | ResponseContractEvent | ResponseSend | ResponseSendDeadlineExceeded | ResponseGetAssetDetails | ResponseIssue | ResponseReissue | ResponseBurn | ResponseDelegate | ResponseGetDelegateInfo | ResponseRecoverVtxos | ResponseRecoverVtxosEvent | ResponseGetRecoverableBalance | ResponseGetExpiringVtxos | ResponseRenewVtxos | ResponseRenewVtxosEvent | ResponseGetExpiredBoardingUtxos | ResponseSweepExpiredBoardingUtxos | ResponseCosignOnchainTx | ResponseSendOnchain | ResponseMigrateDeprecatedSignerVtxos | ResponseMigrateDeprecatedSignerVtxosEvent | ResponseGetDeprecatedSignerStatus | ResponseRestoreWallet | ResponseArkadeCash);
|
|
2965
2958
|
declare class WalletMessageHandler implements MessageHandler<WalletUpdaterRequest, WalletUpdaterResponse> {
|
|
2966
2959
|
readonly messageTag: string;
|
|
2967
2960
|
private wallet;
|
|
@@ -3062,9 +3055,8 @@ declare class WalletMessageHandler implements MessageHandler<WalletUpdaterReques
|
|
|
3062
3055
|
* arkcash) are excluded by default, mirroring {@link ReadonlyWallet.getVtxos}:
|
|
3063
3056
|
* they are settled in their own isolated intent and must stay out of the
|
|
3064
3057
|
* wallet's balance / VTXO / coin-selection / pending-tx views that read this.
|
|
3065
|
-
*
|
|
3066
|
-
*
|
|
3067
|
-
* directly and does include them.
|
|
3058
|
+
* Transaction history excludes them too, as does the non-worker
|
|
3059
|
+
* `getTransactionHistory`.
|
|
3068
3060
|
*/
|
|
3069
3061
|
private getVtxosFromRepo;
|
|
3070
3062
|
/**
|
|
@@ -3080,8 +3072,7 @@ declare class WalletMessageHandler implements MessageHandler<WalletUpdaterReques
|
|
|
3080
3072
|
* what it knows is closed — so the coins of a just-registered escrowed
|
|
3081
3073
|
* contract would count as available until the next poll.
|
|
3082
3074
|
*
|
|
3083
|
-
* Recovery-only contracts are skipped
|
|
3084
|
-
* {@link getVtxosFromRepo}).
|
|
3075
|
+
* Recovery-only contracts are skipped (see {@link getVtxosFromRepo}).
|
|
3085
3076
|
*/
|
|
3086
3077
|
private repoSnapshot;
|
|
3087
3078
|
/**
|
|
@@ -3239,6 +3230,8 @@ type MessageBusInitConfig = {
|
|
|
3239
3230
|
declare class ServiceWorkerReadonlyWallet implements IReadonlyWallet {
|
|
3240
3231
|
readonly serviceWorker: ServiceWorker;
|
|
3241
3232
|
protected readonly messageTag: string;
|
|
3233
|
+
readonly arkadeCash: (request: ArkadeCashRequest) => Promise<ArkadeCashResponse | undefined>;
|
|
3234
|
+
private cashRequest;
|
|
3242
3235
|
readonly walletRepository: WalletRepository;
|
|
3243
3236
|
readonly contractRepository: ContractRepository;
|
|
3244
3237
|
readonly identity: ReadonlyIdentity;
|
|
@@ -4396,40 +4389,6 @@ declare class ArkNote implements ExtendedCoin {
|
|
|
4396
4389
|
toString(): string;
|
|
4397
4390
|
}
|
|
4398
4391
|
|
|
4399
|
-
/**
|
|
4400
|
-
* ArkadeCash is a bearer instrument for the Arkade.
|
|
4401
|
-
* It encodes a private key and contract parameters as a bech32m string,
|
|
4402
|
-
* enabling wallet-to-wallet transfers without address exchange.
|
|
4403
|
-
*
|
|
4404
|
-
* Format: arkadecash1... / tarkadecash1... (bech32m encoded)
|
|
4405
|
-
* Payload: version (1 byte) + private key (32 bytes) + server pubkey (32 bytes) + csv timelock sequence (4 bytes)
|
|
4406
|
-
*/
|
|
4407
|
-
declare class ArkadeCash {
|
|
4408
|
-
readonly csvTimelock: RelativeTimelock;
|
|
4409
|
-
readonly hrp: string;
|
|
4410
|
-
static readonly DefaultHRP = "arkadecash";
|
|
4411
|
-
/** The only prefixes minted or accepted: mainnet and test networks. */
|
|
4412
|
-
static readonly HRPs: readonly string[];
|
|
4413
|
-
static readonly Version = 0;
|
|
4414
|
-
static readonly PayloadLength: number;
|
|
4415
|
-
private readonly _privateKey;
|
|
4416
|
-
private readonly _serverPubKey;
|
|
4417
|
-
private readonly _publicKey;
|
|
4418
|
-
constructor(privateKey: Uint8Array, serverPubKey: Uint8Array, csvTimelock: RelativeTimelock, hrp?: string);
|
|
4419
|
-
/** The note's private key. Returns a fresh copy; mutating it is a no-op. */
|
|
4420
|
-
get privateKey(): Uint8Array;
|
|
4421
|
-
/** The server's public key. Returns a fresh copy; mutating it is a no-op. */
|
|
4422
|
-
get serverPubKey(): Uint8Array;
|
|
4423
|
-
/** The note's public key. Returns a fresh copy; mutating it is a no-op. */
|
|
4424
|
-
get publicKey(): Uint8Array;
|
|
4425
|
-
static generate(serverPubKey: Uint8Array, csvTimelock: RelativeTimelock, hrp?: string): ArkadeCash;
|
|
4426
|
-
static fromString(encoded: string): ArkadeCash;
|
|
4427
|
-
toString(): string;
|
|
4428
|
-
get identity(): SingleKey;
|
|
4429
|
-
get vtxoScript(): DefaultVtxo.Script;
|
|
4430
|
-
address(addressHrp: string): ArkAddress;
|
|
4431
|
-
}
|
|
4432
|
-
|
|
4433
4392
|
/**
|
|
4434
4393
|
* Arkade Batch Handler
|
|
4435
4394
|
*
|
|
@@ -5562,9 +5521,11 @@ declare namespace bignum {
|
|
|
5562
5521
|
* handler: pass a `contractManager` to {@link Arkade.connect} and call
|
|
5563
5522
|
* {@link ArkadeContract.register} to persist and watch a contract.
|
|
5564
5523
|
*
|
|
5565
|
-
* Functions are typed from the program's literal shape (`inputs: [{ name: "preimage",
|
|
5566
|
-
* "bytes" }]` → `functions.claim(preimage: Uint8Array)`).
|
|
5567
|
-
* `
|
|
5524
|
+
* Functions are typed from the program's literal shape (`tapscript.inputs: [{ name: "preimage",
|
|
5525
|
+
* type: "bytes" }]` → `functions.claim({ tapscript: [preimage: Uint8Array] })`). Each segment's
|
|
5526
|
+
* `witness` names its own `inputs`, and the call passes them under that segment's key. For a
|
|
5527
|
+
* program stored in a variable use `satisfies Program`; a `: Program` annotation widens the
|
|
5528
|
+
* literal type away. Typed `params`
|
|
5568
5529
|
* descriptors `{ name, type }` make the list authoritative (every param bound, every `$name`
|
|
5569
5530
|
* declared, values type-checked).
|
|
5570
5531
|
*
|
|
@@ -5584,8 +5545,12 @@ declare namespace bignum {
|
|
|
5584
5545
|
* ],
|
|
5585
5546
|
* functions: {
|
|
5586
5547
|
* claim: {
|
|
5587
|
-
*
|
|
5588
|
-
*
|
|
5548
|
+
* tapscript: {
|
|
5549
|
+
* signers: ["$server"],
|
|
5550
|
+
* asm: ["HASH160", "$hash", "EQUAL"],
|
|
5551
|
+
* inputs: [{ name: "preimage", type: "bytes" }],
|
|
5552
|
+
* witness: ["preimage"],
|
|
5553
|
+
* },
|
|
5589
5554
|
* arkadeScript: { asm: payTo, witness: [0] },
|
|
5590
5555
|
* },
|
|
5591
5556
|
* },
|
|
@@ -5595,7 +5560,7 @@ declare namespace bignum {
|
|
|
5595
5560
|
* // `server` is declared in `params`, so it defaults to the client's operator key.
|
|
5596
5561
|
* const htlc = arkade.contract(htlcProgram, { hash, receiver, amount: 10_000n });
|
|
5597
5562
|
* // `preimage` is typed Uint8Array; calling `claim()` with no args is a type error.
|
|
5598
|
-
* const { txid } = await htlc.functions.claim(preimage).to(receiver, 10_000n).send();
|
|
5563
|
+
* const { txid } = await htlc.functions.claim({ tapscript: [preimage] }).to(receiver, 10_000n).send();
|
|
5599
5564
|
* ```
|
|
5600
5565
|
*
|
|
5601
5566
|
* @module arkade/contract
|
|
@@ -5611,14 +5576,24 @@ type ArgsTuple<I extends readonly InputDef[]> = {
|
|
|
5611
5576
|
[K in keyof I]: ArkadeValueType[I[K]["type"]];
|
|
5612
5577
|
};
|
|
5613
5578
|
/**
|
|
5614
|
-
*
|
|
5615
|
-
* names group into one struct or array argument at runtime; dotted or widened names
|
|
5579
|
+
* One segment's call arguments, one per source parameter (none when it declares no `inputs`).
|
|
5580
|
+
* Dotted input names group into one struct or array argument at runtime; dotted or widened names
|
|
5581
|
+
* stay loose.
|
|
5616
5582
|
*/
|
|
5617
|
-
type
|
|
5583
|
+
type SegmentArgs<S> = S extends {
|
|
5618
5584
|
inputs: infer I extends readonly InputDef[];
|
|
5619
5585
|
} ? string extends I[number]["name"] ? ArkadeNestedValue[] : Extract<I[number]["name"], `${string}.${string}`> extends never ? ArgsTuple<I> : ArkadeNestedValue[] : [];
|
|
5586
|
+
type WitnessSegment = "tapscript" | "arkadeScript";
|
|
5587
|
+
/** A function's call argument: one key for each segment that declares non-empty `inputs`. */
|
|
5588
|
+
type CallArgs<F extends ArkadeFunction> = {
|
|
5589
|
+
[K in WitnessSegment as SegmentArgs<F[K]> extends readonly [] ? never : K]: SegmentArgs<F[K]>;
|
|
5590
|
+
};
|
|
5591
|
+
/** The call argument of a function of a widened {@link Program}. */
|
|
5592
|
+
type LooseCallArgs = Partial<Record<WitnessSegment, readonly ArkadeNestedValue[]>>;
|
|
5593
|
+
/** The call signature arguments for one function: nullary when no segment declares inputs. */
|
|
5594
|
+
type FnArgs<F extends ArkadeFunction> = keyof CallArgs<F> extends never ? [] : [args: CallArgs<F>];
|
|
5620
5595
|
/** A contract's functions returning `R`: typed per function for a literal program, else loose. */
|
|
5621
|
-
type FunctionMap<P extends Program, R> = string extends keyof P["functions"] ? Record<string, (
|
|
5596
|
+
type FunctionMap<P extends Program, R> = string extends keyof P["functions"] ? Record<string, (args?: LooseCallArgs) => R> : {
|
|
5622
5597
|
[K in keyof P["functions"]]: (...args: FnArgs<P["functions"][K]>) => R;
|
|
5623
5598
|
};
|
|
5624
5599
|
/**
|
|
@@ -5669,7 +5644,8 @@ interface Utxo {
|
|
|
5669
5644
|
interface ArkadeUnlocker {
|
|
5670
5645
|
readonly contract: ArkadeContract<any>;
|
|
5671
5646
|
readonly fn: CompiledProgramFunction;
|
|
5672
|
-
|
|
5647
|
+
/** Bound call inputs, by the segment whose witness names them. */
|
|
5648
|
+
readonly args: Readonly<Record<WitnessSegment, Record<string, ArkadeArgValue>>>;
|
|
5673
5649
|
}
|
|
5674
5650
|
/**
|
|
5675
5651
|
* An asset-group transfer attached to a spend: which inputs supply the asset and
|
|
@@ -5702,7 +5678,7 @@ interface ArkadeSpendResult {
|
|
|
5702
5678
|
signedCheckpointTxs: string[];
|
|
5703
5679
|
}
|
|
5704
5680
|
/** The callable spending paths of a contract. */
|
|
5705
|
-
type CallableFunctions = Record<string, (
|
|
5681
|
+
type CallableFunctions = Record<string, (args?: LooseCallArgs) => ArkadeTransactionBuilder>;
|
|
5706
5682
|
/** What {@link Arkade} needs from the operator; see {@link ArkadeConnectOptions.arkade}. */
|
|
5707
5683
|
type ArkadeServerProvider = Pick<OperatorProvider, "getInfo"> & Partial<ArkadeBroadcaster & Pick<OperatorProvider, "cosignOnchainTx">>;
|
|
5708
5684
|
/** Fields shared by both forms of {@link ArkadeConnectOptions}. */
|
|
@@ -5897,7 +5873,10 @@ declare class ArkadeContract<P extends Program = Program> {
|
|
|
5897
5873
|
get address(): string;
|
|
5898
5874
|
/** Taproot output script. */
|
|
5899
5875
|
get pkScript(): Uint8Array;
|
|
5900
|
-
/**
|
|
5876
|
+
/**
|
|
5877
|
+
* Callable spending paths: `functions.<name>({ tapscript: [...], arkadeScript: [...] })`
|
|
5878
|
+
* (see {@link ContractFunctions}).
|
|
5879
|
+
*/
|
|
5901
5880
|
get functions(): ContractFunctions<P>;
|
|
5902
5881
|
/** Spending paths bound to their arguments, for `.from(coins, contract.unlock.<name>(...))`. */
|
|
5903
5882
|
get unlock(): ContractUnlockers<P>;
|
|
@@ -6604,9 +6583,10 @@ declare function sequenceToTimelock(sequence: number): RelativeTimelock;
|
|
|
6604
6583
|
*/
|
|
6605
6584
|
declare function toXOnly(key: Uint8Array, label?: string): Uint8Array;
|
|
6606
6585
|
|
|
6607
|
-
declare const buildVersion = "0.9.9";
|
|
6608
6586
|
/** The SDK's own version string, sourced from package.json */
|
|
6609
6587
|
declare const sdkVersion: string;
|
|
6588
|
+
|
|
6589
|
+
declare const buildVersion = "0.9.9";
|
|
6610
6590
|
/**
|
|
6611
6591
|
* Wraps a transport-level `fetch` rejection (DNS failure, connection refused,
|
|
6612
6592
|
* TLS or CORS error) with the request method and URL, preserving the original
|
|
@@ -6817,4 +6797,4 @@ declare class AssetManager extends ReadonlyAssetManager implements IAssetManager
|
|
|
6817
6797
|
private burnWith;
|
|
6818
6798
|
}
|
|
6819
6799
|
|
|
6820
|
-
export { ARKADE_MAGIC, ARKADE_SALTED_PREIMAGE_TAG, ARKADE_SWAP_PREIMAGE_TAG, ASSET_CARRIER_SATS, Activity, ActivityRegistry, AddressAllocationCapable, AmbiguousRouteError, type AnchorBumper,
|
|
6800
|
+
export { ARKADE_MAGIC, ARKADE_SALTED_PREIMAGE_TAG, ARKADE_SWAP_PREIMAGE_TAG, ASSET_CARRIER_SATS, Activity, ActivityRegistry, AddressAllocationCapable, AmbiguousRouteError, type AnchorBumper, ArkNote, type ArkPsbtFieldCoder, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ArkTransaction, type ArkTxInput, Arkade, type ArkadeBatchInput, ArkadeBroadcaster, ArkadeCashClaimResult, ArkadeCashRecord, type ArkadeCashRequest, type ArkadeCashResponse, type ArkadeCashStatus, type ArkadeCashStatusReport, ArkadeCashTx, ArkadeContractParams, type ArkadeExtendedCoin, type ArkadeExtendedVirtualCoin, ArkadeInfo, ArkadeReader, ArkadeService, Asset, AssetDetails, AssetManager, AtomicWalletState, BIP21, BIP21Error, type BIP21Params, type BIP21ParseResult, BIP322, BLOCKED_UPGRADE_TIMEOUT_MS, Batch, BatchExpiryPolicy, BatchRegistration, BatchRegistrationPageFilter, BatchRegistrationRepository, BurnParams, CSVMultisigTapscript, CachingArkProvider, CachingOperatorProvider, ChainTx, Coin, ConditionWitness, ConnectionDisposedError, Contract, ContractEvent, ContractFilter, ContractRepository, ContractSyncState, ContractVtxoEvent, ContractWatcherConfig, ContractWithVtxos, CosignerPublicKey, CreateContractParams, DEFAULT_MESSAGE_TIMEOUTS, DEFAULT_PASSKEY_LABEL, DatabaseUpgradeBlockedError, DelegateInfo, DelegateNotConfiguredError, DescriptorIdentity, type DescriptorIdentityOptions, type DescriptorOptions, DescriptorProvider, type DescriptorSigner, DescriptorSigningProviderMissingError, DescriptorSigningRequest, type DeterministicSigner, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, type BlockHeader as ElectrumBlockHeader, ElectrumOnchainProvider, type TransactionHistory as ElectrumTransactionHistory, type Unspent as ElectrumUnspent, type EmulatorEntry, EmulatorPacket, EmulatorProvider, EncodedVtxoScript, Estimator, type ExcludableVtxo, type ExecutorEvent, type ExecutorOptions, type ExitDelay, type ExitFeeWallet, type ExitMode, type ExitOptions, type ExitPackage, type ExitQuote, type ExitStep, type ExitTotals, type ExitVtxoInfo, ExplorerTransaction, ExtendedCoin, ExtendedContractVtxo, ExtendedVirtualCoin, Extension, ExtensionNotFoundError, type ExtensionPacket, FeeAmount, FeeInfo, FeeOutput, FetchError, GetNewAddressesOptions, GetOperatorInfoOptions, GetSpendableVtxosFilter, GetVtxosFilter, GetVtxosOptions, HDAllocationCapable, HDDescriptorProvider, type HDDeterministicSignCapable, HDWalletCapable, IAssetManager, IContractManager, IDelegateManager, IReadonlyAssetManager, IReadonlyWallet, IVtxoManager, IWallet, Identity, InMemoryBatchRegistrationRepository, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBBatchRegistrationRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexerProvider, InputExpiryFloor, IntentFeeConfig, IssuanceParams, IssuanceResult, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, type ManagedConnection, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, type MessageHandler, type MessageTimeouts, MigrationGlobalSkipReason, MigrationLegSkipReason, MissingSigningDescriptorError, MnemonicIdentity, type MnemonicOptions, Network, NetworkName, type NetworkOptions, NewAddress, NormalizedExtendedVirtualCoin, NormalizedVtxoPage, OffchainInput, type OffchainTx, type OnExitObserved, OnchainCosignPreflightError, OnchainInput, OnchainProvider, OnchainWallet, OperatorInfo, OperatorProvider, Outpoint, OversizedChangeError, P2A, PageRequest, PageResult, PaginationOptions, type ParsedArkContract, PasskeyCancelled, type PasskeyMnemonic, type PasskeySource, PasskeyUnconfirmed, PathContext, PathSelection, type PaymentHandle, type PaymentOption, type PaymentRail, type PaymentRequest, PaymentRouter, type PaymentStatus, PrevArkTxField, PrevoutTxField, PrfUnavailable, type PrfUnavailableReason, Proof, ProviderConnectionState, type ProvisionedClaimSecret, type ProvisionedKey, READ_TIMEOUT_MS, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlyIdentity, ReadonlyWallet, ReadonlyWalletError, Recipient, ReissuanceParams, RelativeTimelock, RenewVtxosOptions, type RequestEnvelope, type ResponseEnvelope, type RouteQuote, type RouteResult, type RouterContext, type RouterPreferences, ScriptVtxoCursor, ScriptVtxoPageOptions, SeedIdentity, type SeedIdentityOptions, SendBitcoinParams, SendDeadlineExceededError, SendOnchainParams, SendParams, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, type ServiceWorkerWalletMode, SettleParams, SettlementConfig, SettlementEvent, SignedProof, SignerSession, SignerStatus, StaticDescriptorProvider, Status, StorageConfig, StoredVtxo, TapLeafScript, Transaction, TransactionHistoryPageCursor, TransactionHistoryPageFilter, TreeNonces, TreePartialSigs, TxNotificationEvent, TxTree, TxWeightEstimator, UnannotatableInputError, UnilateralExit, UnknownPacket, Unroll, UnsupportedProgramVersionError, type VSize, type VerifyServerSignatures, VirtualCoin, VirtualTx, VirtualTxRepository, VtxoBranch, type VtxoExclusion, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, Wallet, WalletBalance, WalletCannotSignError, WalletMessageHandler, WalletNotInitializedError, WalletRepository, type WalletRestoreHook, WatchedScript, type WebAuthnClient, WsElectrumChainSource, adoptContractDescriptor, arkAssetRail, arkRail, arkTarget, index as arkade, assembleBtcdTaprootTree, assertFinalCommitmentMatchesValidated, assertNoAssets, assertNoSelection, assertNonNegativeMs, assertSendDeadline, assertSendableAmount, assertSubmittedArkTxid, assertTimerMs, assertValidServerUnrollScript, index$1 as asset, assetsOf, awaitTransaction, btcTarget, buildForfeitTx, buildOffchainTx, buildPreimageMessage, buildSaltedPreimageMessage, buildVersion, captureSendDeadline, claimWithPreimageIdentity, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, contractPreimage, contractSigner, createAssetPacket, createDefaultPaymentRouter, createManagedConnection, createPrfPasskey, decodeArkContract, deleteByIndex, deriveDescriptorLeafCompressedPubKey, deriveDescriptorLeafPubKey, deserializeExitPackage, encodeArkContract, evaluatePrf, exitObserverFor, gateExclusion, gatedContracts, getAllByIndexValues, getArkPsbtFields, hasBoardingTxExpired, identityDescriptor, invoiceTarget, isArkContract, isBtcAddress, isCltvSatisfied, isContractGenericallySpendable, isCosignFallback, isCsvSpendable, isDeterministicSigner, isHDDeterministicSignCapable, isLightningInvoice, isLnurl, isMessageBusInitializingError, isMessageBusNotInitializedError, isPerArtifactDescriptor, isRetryableProviderError, isValidArkAddress, logExcludedVtxos, makeHandle, matchServerCheckpoints, mnemonicFromPrf, normalizeToDescriptor, notifyExitObserved, onchainRail, openDatabase, outpointExclusion, outpointReasons, parseHDDescriptor, prfSupport, promisifyRequest, provisionClaimSecret, provisionRefundKey, readArkadeCash, registerWalletRestoreHook, resolveAssetAmount, resolveSendAmount, sdkVersion, selectCoinsWithAsset, selectionOf, sequenceToTimelock, serializeExitPackage, setArkPsbtField, setupServiceWorker, signAndSubmitOffchainTx, submitViaEmulator, timelockToSequence, toXOnly, tryResolveSendAmount, validateBatchRecipients, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, walletFeeSource };
|