@sidhujag/sysweb3-keyring 2.1.0 → 2.1.1
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/CHANGELOG.md +11 -0
- package/README.md +46 -108
- package/cjs/evm-fees.js +223 -0
- package/cjs/evm-fees.js.map +1 -0
- package/cjs/keyring-core.js +1 -227
- package/cjs/keyring-core.js.map +1 -1
- package/cjs/keyring-manager.js +4 -3
- package/cjs/keyring-manager.js.map +1 -1
- package/cjs/software.js +12 -11
- package/cjs/software.js.map +1 -1
- package/cjs/transactions/ethereum.js +194 -190
- package/cjs/transactions/ethereum.js.map +1 -1
- package/cjs/transactions/evm-local-signer.js +28 -7
- package/cjs/transactions/evm-local-signer.js.map +1 -1
- package/cjs/transactions/evm-submission.js +179 -0
- package/cjs/transactions/evm-submission.js.map +1 -0
- package/cjs/transactions/index.js +1 -0
- package/cjs/transactions/index.js.map +1 -1
- package/cjs/transactions/prepared-evm.js +2 -0
- package/cjs/transactions/prepared-evm.js.map +1 -1
- package/cjs/types.js.map +1 -1
- package/cjs/utils/derivation-paths.js +4 -3
- package/cjs/utils/derivation-paths.js.map +1 -1
- package/cjs/utils/watch-descriptor.js +3 -2
- package/cjs/utils/watch-descriptor.js.map +1 -1
- package/esm/types.js.map +1 -1
- package/esm/utils/derivation-paths.js +2 -1
- package/esm/utils/derivation-paths.js.map +1 -1
- package/package.json +24 -11
- package/types/evm-fees.d.ts +42 -0
- package/types/keyring-core.d.ts +3 -8
- package/types/keyring-manager.d.ts +8 -3
- package/types/software.d.ts +6 -11
- package/types/transactions/ethereum.d.ts +10 -8
- package/types/transactions/evm-local-signer.d.ts +4 -1
- package/types/transactions/evm-submission.d.ts +48 -0
- package/types/transactions/index.d.ts +1 -0
- package/types/types.d.ts +4 -0
- package/cjs/bip84-native.js +0 -8
- package/cjs/bip84-native.js.map +0 -1
- package/cjs/public-bip84.js +0 -157
- package/cjs/public-bip84.js.map +0 -1
- package/cjs/software-utxo-account.js +0 -12
- package/cjs/software-utxo-account.js.map +0 -1
- package/cjs/transactions/bip84-native-plan.js +0 -481
- package/cjs/transactions/bip84-native-plan.js.map +0 -1
- package/cjs/transactions/prepared-bip84.js +0 -214
- package/cjs/transactions/prepared-bip84.js.map +0 -1
- package/types/bip84-native.d.ts +0 -3
- package/types/public-bip84.d.ts +0 -39
- package/types/software-utxo-account.d.ts +0 -13
- package/types/transactions/bip84-native-plan.d.ts +0 -83
- package/types/transactions/prepared-bip84.d.ts +0 -27
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.snapshotPreparedBip84Request = snapshotPreparedBip84Request;
|
|
7
|
-
exports.clearBip84PrivateNodes = clearBip84PrivateNodes;
|
|
8
|
-
exports.signValidatedBip84Plan = signValidatedBip84Plan;
|
|
9
|
-
const secp256k1_1 = __importDefault(require("@bitcoinerlab/secp256k1"));
|
|
10
|
-
const bitcoinjs_lib_1 = require("bitcoinjs-lib");
|
|
11
|
-
const public_bip84_1 = require("../public-bip84");
|
|
12
|
-
const bip84_native_plan_1 = require("./bip84-native-plan");
|
|
13
|
-
/** Private host snapshot. A public prepared DTO never carries signing authority. */
|
|
14
|
-
function snapshotPreparedBip84Request(input) {
|
|
15
|
-
const r = (0, bip84_native_plan_1.record)(input, ['account', 'prepared']);
|
|
16
|
-
const a = (0, bip84_native_plan_1.record)(r.account, ['type', 'index', 'expectedAccountKey']);
|
|
17
|
-
const p = (0, bip84_native_plan_1.record)(r.prepared, ['plan', 'unsignedTransaction', 'feeSatoshis']);
|
|
18
|
-
if (a.type !== 'HDAccount')
|
|
19
|
-
return (0, bip84_native_plan_1.fail)('ACCOUNT_MISMATCH');
|
|
20
|
-
const accountIndex = (0, bip84_native_plan_1.index)(a.index);
|
|
21
|
-
if (typeof a.expectedAccountKey !== 'string' ||
|
|
22
|
-
a.expectedAccountKey.length > 112 ||
|
|
23
|
-
typeof p.unsignedTransaction !== 'string' ||
|
|
24
|
-
p.unsignedTransaction.length > bip84_native_plan_1.LIMITS.unsignedBytes * 2 ||
|
|
25
|
-
!/^(?:[0-9a-f]{2})+$/.test(p.unsignedTransaction) ||
|
|
26
|
-
typeof p.feeSatoshis !== 'string' ||
|
|
27
|
-
!/^(0|[1-9][0-9]{0,18})$/.test(p.feeSatoshis))
|
|
28
|
-
return (0, bip84_native_plan_1.fail)('INVALID_REQUEST');
|
|
29
|
-
const validated = (0, bip84_native_plan_1.validateBip84NativePlan)(p.plan);
|
|
30
|
-
if (accountIndex !== validated.prepared.plan.account.accountIndex ||
|
|
31
|
-
a.expectedAccountKey !== validated.prepared.plan.account.canonicalKey)
|
|
32
|
-
return (0, bip84_native_plan_1.fail)('ACCOUNT_MISMATCH');
|
|
33
|
-
if (p.unsignedTransaction !== validated.prepared.unsignedTransaction ||
|
|
34
|
-
p.feeSatoshis !== validated.prepared.feeSatoshis)
|
|
35
|
-
return (0, bip84_native_plan_1.fail)('INVALID_REQUEST');
|
|
36
|
-
return {
|
|
37
|
-
account: Object.freeze({
|
|
38
|
-
type: 'HDAccount',
|
|
39
|
-
index: accountIndex,
|
|
40
|
-
expectedAccountKey: a.expectedAccountKey,
|
|
41
|
-
}),
|
|
42
|
-
validated,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
/** Only operation-owned nodes. No session/shared key objects may be supplied. */
|
|
46
|
-
function clearBip84PrivateNodes(nodes) {
|
|
47
|
-
while (nodes.length) {
|
|
48
|
-
const node = nodes.pop();
|
|
49
|
-
try {
|
|
50
|
-
node.privateKey?.fill(0);
|
|
51
|
-
}
|
|
52
|
-
catch {
|
|
53
|
-
// Continue retiring the other owned buffers and the operation token.
|
|
54
|
-
// JS/library copies and inaccessible buffers are not claimed zeroized.
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
const equal = (left, right) => Buffer.from(left).equals(Buffer.from(right));
|
|
59
|
-
/** Internally owned PSBT only. No provider, generic SDK signer or partial result. */
|
|
60
|
-
function signValidatedBip84Plan(validated, accountNode, assertCurrent) {
|
|
61
|
-
const nodes = [];
|
|
62
|
-
try {
|
|
63
|
-
const { prepared, psbt, previousOutputs } = validated;
|
|
64
|
-
const { plan } = prepared;
|
|
65
|
-
const profile = (0, bip84_native_plan_1.bip84Profile)(plan.network.network);
|
|
66
|
-
assertCurrent();
|
|
67
|
-
const derivedAccount = (0, public_bip84_1.parseBip84PublicAccount)({
|
|
68
|
-
network: plan.network.network,
|
|
69
|
-
accountKey: accountNode.neutered().toBase58(),
|
|
70
|
-
});
|
|
71
|
-
if (derivedAccount.canonicalKey !== plan.account.canonicalKey ||
|
|
72
|
-
derivedAccount.accountIndex !== plan.account.accountIndex)
|
|
73
|
-
return (0, bip84_native_plan_1.fail)('ACCOUNT_MISMATCH');
|
|
74
|
-
const branches = new Map();
|
|
75
|
-
const children = new Map();
|
|
76
|
-
const publicKeys = [];
|
|
77
|
-
for (const [i, input] of plan.inputs.entries()) {
|
|
78
|
-
assertCurrent();
|
|
79
|
-
let branch = branches.get(input.branch);
|
|
80
|
-
if (!branch) {
|
|
81
|
-
branch = accountNode.derive(input.branch);
|
|
82
|
-
nodes.push(branch);
|
|
83
|
-
if (branch.index !== input.branch)
|
|
84
|
-
return (0, bip84_native_plan_1.fail)('ACCOUNT_MISMATCH');
|
|
85
|
-
branches.set(input.branch, branch);
|
|
86
|
-
}
|
|
87
|
-
const path = `${input.branch}/${input.index}`;
|
|
88
|
-
let child = children.get(path);
|
|
89
|
-
if (!child) {
|
|
90
|
-
child = branch.derive(input.index);
|
|
91
|
-
nodes.push(child);
|
|
92
|
-
if (child.index !== input.index)
|
|
93
|
-
return (0, bip84_native_plan_1.fail)('ACCOUNT_MISMATCH');
|
|
94
|
-
children.set(path, child);
|
|
95
|
-
}
|
|
96
|
-
const pubkey = Uint8Array.from(child.publicKey);
|
|
97
|
-
const payment = bitcoinjs_lib_1.payments.p2wpkh({
|
|
98
|
-
pubkey,
|
|
99
|
-
network: profile.addressNetwork,
|
|
100
|
-
});
|
|
101
|
-
if (pubkey.length !== 33 ||
|
|
102
|
-
!payment.output ||
|
|
103
|
-
!equal(payment.output, previousOutputs[i].script))
|
|
104
|
-
return (0, bip84_native_plan_1.fail)('INPUT_MISMATCH');
|
|
105
|
-
publicKeys.push(pubkey);
|
|
106
|
-
const signer = child;
|
|
107
|
-
assertCurrent();
|
|
108
|
-
psbt.signInput(i, {
|
|
109
|
-
publicKey: pubkey,
|
|
110
|
-
sign(hash) {
|
|
111
|
-
assertCurrent();
|
|
112
|
-
const signature = signer.sign(hash);
|
|
113
|
-
assertCurrent();
|
|
114
|
-
return signature;
|
|
115
|
-
},
|
|
116
|
-
}, [bitcoinjs_lib_1.Transaction.SIGHASH_ALL]);
|
|
117
|
-
assertCurrent();
|
|
118
|
-
const partial = psbt.data.inputs[i].partialSig;
|
|
119
|
-
if (!partial ||
|
|
120
|
-
partial.length !== 1 ||
|
|
121
|
-
!equal(partial[0].pubkey, pubkey) ||
|
|
122
|
-
bitcoinjs_lib_1.script.signature.decode(partial[0].signature).hashType !==
|
|
123
|
-
bitcoinjs_lib_1.Transaction.SIGHASH_ALL ||
|
|
124
|
-
psbt.validateSignaturesOfInput(i, (key, hash, signature) => equal(key, pubkey) && secp256k1_1.default.verify(hash, key, signature, true), pubkey) !== true)
|
|
125
|
-
return (0, bip84_native_plan_1.fail)('SIGNATURE_INVALID');
|
|
126
|
-
}
|
|
127
|
-
// Verify change from the private-derived account as well as the public plan.
|
|
128
|
-
if (plan.change) {
|
|
129
|
-
assertCurrent();
|
|
130
|
-
const branch = accountNode.neutered().derive(1);
|
|
131
|
-
if (branch.index !== 1)
|
|
132
|
-
return (0, bip84_native_plan_1.fail)('ACCOUNT_MISMATCH');
|
|
133
|
-
const child = branch.derive(plan.change.index);
|
|
134
|
-
if (child.index !== plan.change.index)
|
|
135
|
-
return (0, bip84_native_plan_1.fail)('ACCOUNT_MISMATCH');
|
|
136
|
-
const payment = bitcoinjs_lib_1.payments.p2wpkh({
|
|
137
|
-
pubkey: child.publicKey,
|
|
138
|
-
network: profile.addressNetwork,
|
|
139
|
-
});
|
|
140
|
-
if (!payment.output || !equal(payment.output, psbt.txOutputs[1].script))
|
|
141
|
-
return (0, bip84_native_plan_1.fail)('INPUT_MISMATCH');
|
|
142
|
-
}
|
|
143
|
-
if (psbt.toBuffer().length > bip84_native_plan_1.LIMITS.psbtBytes)
|
|
144
|
-
return (0, bip84_native_plan_1.fail)('LIMIT_EXCEEDED');
|
|
145
|
-
assertCurrent();
|
|
146
|
-
for (let i = 0; i < plan.inputs.length; i++) {
|
|
147
|
-
psbt.finalizeInput(i);
|
|
148
|
-
const input = psbt.data.inputs[i];
|
|
149
|
-
if (!(input.finalScriptWitness instanceof Uint8Array) ||
|
|
150
|
-
input.finalScriptWitness.length === 0 ||
|
|
151
|
-
(input.finalScriptSig !== undefined && input.finalScriptSig.length > 0))
|
|
152
|
-
return (0, bip84_native_plan_1.fail)('SIGNATURE_INVALID');
|
|
153
|
-
}
|
|
154
|
-
if (psbt.toBuffer().length > bip84_native_plan_1.LIMITS.psbtBytes)
|
|
155
|
-
return (0, bip84_native_plan_1.fail)('LIMIT_EXCEEDED');
|
|
156
|
-
assertCurrent();
|
|
157
|
-
// SJS overrides fee/extraction helpers. Their success is not our fee proof.
|
|
158
|
-
const bytes = psbt.extractTransaction().toBuffer();
|
|
159
|
-
if (bytes.length > bip84_native_plan_1.LIMITS.signedBytes)
|
|
160
|
-
return (0, bip84_native_plan_1.fail)('LIMIT_EXCEEDED');
|
|
161
|
-
const transaction = bitcoinjs_lib_1.Transaction.fromBuffer(bytes);
|
|
162
|
-
if (!equal(transaction.toBuffer(), bytes) ||
|
|
163
|
-
transaction.ins.length !== plan.inputs.length)
|
|
164
|
-
return (0, bip84_native_plan_1.fail)('SIGNATURE_INVALID');
|
|
165
|
-
for (const [i, input] of transaction.ins.entries()) {
|
|
166
|
-
assertCurrent();
|
|
167
|
-
if (input.script.length !== 0 ||
|
|
168
|
-
input.witness.length !== 2 ||
|
|
169
|
-
!equal(input.witness[1], publicKeys[i]))
|
|
170
|
-
return (0, bip84_native_plan_1.fail)('SIGNATURE_INVALID');
|
|
171
|
-
const signature = bitcoinjs_lib_1.script.signature.decode(input.witness[0]);
|
|
172
|
-
const scriptCode = bitcoinjs_lib_1.payments.p2pkh({ pubkey: publicKeys[i] }).output;
|
|
173
|
-
if (signature.hashType !== bitcoinjs_lib_1.Transaction.SIGHASH_ALL ||
|
|
174
|
-
!scriptCode ||
|
|
175
|
-
!equal(bitcoinjs_lib_1.script.signature.encode(signature.signature, signature.hashType), input.witness[0]) ||
|
|
176
|
-
!secp256k1_1.default.verify(transaction.hashForWitnessV0(i, scriptCode, previousOutputs[i].value, bitcoinjs_lib_1.Transaction.SIGHASH_ALL), publicKeys[i], signature.signature, true))
|
|
177
|
-
return (0, bip84_native_plan_1.fail)('SIGNATURE_INVALID');
|
|
178
|
-
}
|
|
179
|
-
const unsigned = transaction.clone();
|
|
180
|
-
unsigned.stripWitnesses();
|
|
181
|
-
if (unsigned.toHex() !== prepared.unsignedTransaction)
|
|
182
|
-
return (0, bip84_native_plan_1.fail)('SIGNATURE_INVALID');
|
|
183
|
-
const fee = previousOutputs.reduce((sum, output) => sum + output.value, 0n) -
|
|
184
|
-
transaction.outs.reduce((sum, output) => sum + output.value, 0n);
|
|
185
|
-
const virtualSize = transaction.virtualSize();
|
|
186
|
-
if (fee < 0n ||
|
|
187
|
-
fee.toString() !== prepared.feeSatoshis ||
|
|
188
|
-
fee > bip84_native_plan_1.LIMITS.maxFee ||
|
|
189
|
-
fee > BigInt(plan.feeLimits.maxFeeSatoshis) ||
|
|
190
|
-
!Number.isSafeInteger(virtualSize) ||
|
|
191
|
-
virtualSize <= 0 ||
|
|
192
|
-
fee > BigInt(virtualSize) * bip84_native_plan_1.LIMITS.maxFeeRate ||
|
|
193
|
-
fee > BigInt(virtualSize) * BigInt(plan.feeLimits.maxFeeRateSatPerVByte))
|
|
194
|
-
return (0, bip84_native_plan_1.fail)('FEE_LIMIT');
|
|
195
|
-
assertCurrent();
|
|
196
|
-
return Object.freeze({
|
|
197
|
-
rawTransaction: transaction.toHex(),
|
|
198
|
-
txid: transaction.getId(),
|
|
199
|
-
wtxid: Buffer.from(transaction.getHash(true)).reverse().toString('hex'),
|
|
200
|
-
unsignedTransaction: prepared.unsignedTransaction,
|
|
201
|
-
feeSatoshis: fee.toString(),
|
|
202
|
-
virtualSize,
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
catch (error) {
|
|
206
|
-
if (error instanceof bip84_native_plan_1.Bip84NativeError)
|
|
207
|
-
throw error;
|
|
208
|
-
return (0, bip84_native_plan_1.fail)('SIGNATURE_INVALID');
|
|
209
|
-
}
|
|
210
|
-
finally {
|
|
211
|
-
clearBip84PrivateNodes(nodes);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
//# sourceMappingURL=prepared-bip84.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prepared-bip84.js","sourceRoot":"","sources":["../../../src/transactions/prepared-bip84.ts"],"names":[],"mappings":";;;;;AAmCA,oEAsCC;AAGD,wDAUC;AAMD,wDA4LC;AAxRD,wEAA0C;AAE1C,iDAA8D;AAE9D,kDAA0D;AAC1D,2DAU6B;AAmB7B,oFAAoF;AACpF,SAAgB,4BAA4B,CAAC,KAAc;IAIzD,MAAM,CAAC,GAAG,IAAA,0BAAM,EAAC,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACjD,MAAM,CAAC,GAAG,IAAA,0BAAM,EAAC,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACrE,MAAM,CAAC,GAAG,IAAA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AAC,mBAAmB;YACjD,WAAW,EAAE,GAAG,CAAC,QAAQ,EAAE;YAC3B,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,oCAAgB;YAAE,MAAM,KAAK,CAAC;QACnD,OAAO,IAAA,wBAAI,EAAC,mBAAmB,CAAC,CAAC;IACnC,CAAC;YAAS,CAAC;QACT,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;AACH,CAAC"}
|
package/types/bip84-native.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/** Pure native-coin BIP84 transfer preparation, without a wallet or provider. */
|
|
2
|
-
export { Bip84NativeError, prepareBip84NativeTransaction, } from './transactions/bip84-native-plan';
|
|
3
|
-
export type { Bip84NativeErrorCode, Bip84NetworkBinding, Bip84Guard, Bip84NativePlan, PreparedBip84NativeTransaction, } from './transactions/bip84-native-plan';
|
package/types/public-bip84.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export type Bip84PublicNetwork = 'bitcoin' | 'syscoin';
|
|
2
|
-
export type Bip84PublicAccountRequest = Readonly<{
|
|
3
|
-
network: Bip84PublicNetwork;
|
|
4
|
-
accountKey: string;
|
|
5
|
-
}>;
|
|
6
|
-
export type Bip84PublicAccount = Readonly<{
|
|
7
|
-
network: Bip84PublicNetwork;
|
|
8
|
-
policy: 'bip84-p2wpkh';
|
|
9
|
-
canonicalKey: string;
|
|
10
|
-
accountIndex: number;
|
|
11
|
-
}>;
|
|
12
|
-
export type Bip84PublicAddressRequest = Bip84PublicAccountRequest & Readonly<{
|
|
13
|
-
branch: 0 | 1;
|
|
14
|
-
index: number;
|
|
15
|
-
}>;
|
|
16
|
-
export type Bip84PublicAddress = Readonly<{
|
|
17
|
-
account: Bip84PublicAccount;
|
|
18
|
-
branch: 0 | 1;
|
|
19
|
-
index: number;
|
|
20
|
-
address: string;
|
|
21
|
-
scriptPubKey: string;
|
|
22
|
-
}>;
|
|
23
|
-
export declare class PublicBip84Error extends Error {
|
|
24
|
-
readonly code: 'INVALID_INPUT' | 'INVALID_ACCOUNT' | 'INVALID_DERIVATION';
|
|
25
|
-
constructor(code: 'INVALID_INPUT' | 'INVALID_ACCOUNT' | 'INVALID_DERIVATION');
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Validate one public account and normalize xpub/zpub aliases. The chosen
|
|
29
|
-
* network and BIP84 policy are explicit; ancestry/purpose is not attested.
|
|
30
|
-
* No keyring, storage, provider, randomness or wallet signing is involved.
|
|
31
|
-
* BIP32Factory runs its upstream deterministic ECC self-tests at module load.
|
|
32
|
-
*/
|
|
33
|
-
export declare function parseBip84PublicAccount(request: Bip84PublicAccountRequest): Bip84PublicAccount;
|
|
34
|
-
/**
|
|
35
|
-
* Derive only /0/index or /1/index from a validated mainnet account key.
|
|
36
|
-
* One bounded input and two child derivations; no discovery, cache or range
|
|
37
|
-
* iteration. Callers own scan limits and privacy consent. Returned data is public.
|
|
38
|
-
*/
|
|
39
|
-
export declare function deriveBip84PublicAddress(request: Bip84PublicAddressRequest): Bip84PublicAddress;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Bip84PublicAccount, Bip84PublicAddress } from './public-bip84';
|
|
2
|
-
import { Bip84NetworkBinding } from './transactions/bip84-native-plan';
|
|
3
|
-
export type Bip84HdPublicRequest = Readonly<{
|
|
4
|
-
network: Bip84NetworkBinding;
|
|
5
|
-
accountIndex: number;
|
|
6
|
-
}>;
|
|
7
|
-
export type Bip84HdPublicResult = Readonly<{
|
|
8
|
-
type: 'HDAccount';
|
|
9
|
-
accountIndex: number;
|
|
10
|
-
account: Bip84PublicAccount;
|
|
11
|
-
receive: Bip84PublicAddress;
|
|
12
|
-
}>;
|
|
13
|
-
export declare function snapshotBip84HdPublicRequest(value: unknown): Bip84HdPublicRequest;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { Psbt, Network } from 'bitcoinjs-lib';
|
|
2
|
-
import { Bip84PublicAccount, Bip84PublicNetwork } from '../public-bip84';
|
|
3
|
-
export type Bip84NetworkBinding = Readonly<{
|
|
4
|
-
network: Bip84PublicNetwork;
|
|
5
|
-
endpoint: string;
|
|
6
|
-
}>;
|
|
7
|
-
export type Bip84Guard = Readonly<{
|
|
8
|
-
assertCurrent(): void;
|
|
9
|
-
}>;
|
|
10
|
-
export type Bip84NativePlan = Readonly<{
|
|
11
|
-
network: Bip84NetworkBinding;
|
|
12
|
-
account: Bip84PublicAccount;
|
|
13
|
-
inputs: readonly Readonly<{
|
|
14
|
-
txid: string;
|
|
15
|
-
vout: number;
|
|
16
|
-
branch: 0 | 1;
|
|
17
|
-
index: number;
|
|
18
|
-
}>[];
|
|
19
|
-
previousTransactions: readonly Readonly<{
|
|
20
|
-
txid: string;
|
|
21
|
-
rawTransaction: string;
|
|
22
|
-
}>[];
|
|
23
|
-
recipient: Readonly<{
|
|
24
|
-
address: string;
|
|
25
|
-
valueSatoshis: string;
|
|
26
|
-
}>;
|
|
27
|
-
change: Readonly<{
|
|
28
|
-
index: number;
|
|
29
|
-
valueSatoshis: string;
|
|
30
|
-
}> | null;
|
|
31
|
-
locktime: 0;
|
|
32
|
-
rbf: boolean;
|
|
33
|
-
feeLimits: Readonly<{
|
|
34
|
-
maxFeeSatoshis: string;
|
|
35
|
-
maxFeeRateSatPerVByte: string;
|
|
36
|
-
}>;
|
|
37
|
-
}>;
|
|
38
|
-
export type PreparedBip84NativeTransaction = Readonly<{
|
|
39
|
-
plan: Bip84NativePlan;
|
|
40
|
-
unsignedTransaction: string;
|
|
41
|
-
feeSatoshis: string;
|
|
42
|
-
}>;
|
|
43
|
-
export type Bip84NativeErrorCode = 'INVALID_REQUEST' | 'LIMIT_EXCEEDED' | 'UNSUPPORTED_NETWORK' | 'UNSUPPORTED_PARENT' | 'ACCOUNT_MISMATCH' | 'INPUT_MISMATCH' | 'FEE_LIMIT' | 'SIGNATURE_INVALID' | 'CANCELLED' | 'BUSY';
|
|
44
|
-
export declare class Bip84NativeError extends Error {
|
|
45
|
-
readonly code: Bip84NativeErrorCode;
|
|
46
|
-
constructor(code: Bip84NativeErrorCode);
|
|
47
|
-
}
|
|
48
|
-
export declare const LIMITS: Readonly<{
|
|
49
|
-
inputs: 64;
|
|
50
|
-
parentBytes: 1000000;
|
|
51
|
-
totalParentBytes: 2000000;
|
|
52
|
-
parentComponents: 8192;
|
|
53
|
-
unsignedBytes: number;
|
|
54
|
-
signedBytes: number;
|
|
55
|
-
psbtBytes: number;
|
|
56
|
-
maxFee: 10000000n;
|
|
57
|
-
maxFeeRate: 1000n;
|
|
58
|
-
}>;
|
|
59
|
-
export type Bip84Profile = Readonly<{
|
|
60
|
-
chainId: number;
|
|
61
|
-
slip44: number;
|
|
62
|
-
currency: string;
|
|
63
|
-
maximumMoney: bigint;
|
|
64
|
-
addressNetwork: Network;
|
|
65
|
-
}>;
|
|
66
|
-
export declare const bip84Profile: (network: Bip84PublicNetwork) => Bip84Profile;
|
|
67
|
-
export declare const fail: (code: Bip84NativeErrorCode) => never;
|
|
68
|
-
export declare function record(value: unknown, fields: readonly string[]): Record<string, unknown>;
|
|
69
|
-
export declare function index(value: unknown): number;
|
|
70
|
-
export declare function snapshotBip84Network(value: unknown): Bip84NetworkBinding;
|
|
71
|
-
export declare function snapshotBip84Guard(value: unknown): () => void;
|
|
72
|
-
export type ValidatedBip84Plan = {
|
|
73
|
-
prepared: PreparedBip84NativeTransaction;
|
|
74
|
-
psbt: Psbt;
|
|
75
|
-
previousOutputs: readonly Readonly<{
|
|
76
|
-
script: Uint8Array;
|
|
77
|
-
value: bigint;
|
|
78
|
-
}>[];
|
|
79
|
-
};
|
|
80
|
-
/** Internal result includes owned mutable transaction data; public entry exports only prepare. */
|
|
81
|
-
export declare function validateBip84NativePlan(value: unknown): ValidatedBip84Plan;
|
|
82
|
-
/** Pure bounded preparation; returned data carries no signing authorization. */
|
|
83
|
-
export declare function prepareBip84NativeTransaction(plan: Bip84NativePlan): PreparedBip84NativeTransaction;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { BIP32Interface } from 'bip32';
|
|
2
|
-
import { PreparedBip84NativeTransaction, ValidatedBip84Plan } from './bip84-native-plan';
|
|
3
|
-
export type PreparedBip84SigningRequest = Readonly<{
|
|
4
|
-
account: Readonly<{
|
|
5
|
-
type: 'HDAccount';
|
|
6
|
-
index: number;
|
|
7
|
-
expectedAccountKey: string;
|
|
8
|
-
}>;
|
|
9
|
-
prepared: PreparedBip84NativeTransaction;
|
|
10
|
-
}>;
|
|
11
|
-
export type SignedBip84NativeTransaction = Readonly<{
|
|
12
|
-
rawTransaction: string;
|
|
13
|
-
txid: string;
|
|
14
|
-
wtxid: string;
|
|
15
|
-
unsignedTransaction: string;
|
|
16
|
-
feeSatoshis: string;
|
|
17
|
-
virtualSize: number;
|
|
18
|
-
}>;
|
|
19
|
-
/** Private host snapshot. A public prepared DTO never carries signing authority. */
|
|
20
|
-
export declare function snapshotPreparedBip84Request(input: unknown): {
|
|
21
|
-
account: PreparedBip84SigningRequest['account'];
|
|
22
|
-
validated: ValidatedBip84Plan;
|
|
23
|
-
};
|
|
24
|
-
/** Only operation-owned nodes. No session/shared key objects may be supplied. */
|
|
25
|
-
export declare function clearBip84PrivateNodes(nodes: BIP32Interface[]): void;
|
|
26
|
-
/** Internally owned PSBT only. No provider, generic SDK signer or partial result. */
|
|
27
|
-
export declare function signValidatedBip84Plan(validated: ValidatedBip84Plan, accountNode: BIP32Interface, assertCurrent: () => void): SignedBip84NativeTransaction;
|