@anywalletkit/wallet-zcash 0.2.5 → 0.2.6
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/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1096,7 +1096,7 @@ var WalletAccountZcash = class _WalletAccountZcash extends WalletAccountReadOnly
|
|
|
1096
1096
|
tx.inputs[i].scriptSig = p2pkhScriptSig(der, this.publicKey);
|
|
1097
1097
|
}
|
|
1098
1098
|
}
|
|
1099
|
-
async
|
|
1099
|
+
async signSpend(spend) {
|
|
1100
1100
|
this.live();
|
|
1101
1101
|
const plan = await this.planSpend(spend);
|
|
1102
1102
|
const params = await this.chainParams();
|
|
@@ -1140,7 +1140,7 @@ var WalletAccountZcash = class _WalletAccountZcash extends WalletAccountReadOnly
|
|
|
1140
1140
|
/** "What you sign": the fully resolved spend (signed, NOT broadcast) or a caller's raw hex. */
|
|
1141
1141
|
async describeTransaction(tx) {
|
|
1142
1142
|
if (typeof tx === "string") return (await this.describeRaw(tx)).desc;
|
|
1143
|
-
return (await this.
|
|
1143
|
+
return (await this.signSpend(tx)).desc;
|
|
1144
1144
|
}
|
|
1145
1145
|
/** Sign without broadcasting. Returns the raw transaction hex. Raw hex input gets the checks `sendTransaction` runs (prevouts through the client) and is returned unchanged, never re-signed. */
|
|
1146
1146
|
async signTransaction(tx, options = {}) {
|
|
@@ -1150,7 +1150,7 @@ var WalletAccountZcash = class _WalletAccountZcash extends WalletAccountReadOnly
|
|
|
1150
1150
|
this.checkMax(desc.fee, (0, import_core7.feeLimit)(this._config.transactionMaxFee, options), "transaction");
|
|
1151
1151
|
return tx;
|
|
1152
1152
|
}
|
|
1153
|
-
const built = await this.
|
|
1153
|
+
const built = await this.signSpend(tx);
|
|
1154
1154
|
this.checkMax(built.fee, (0, import_core7.feeLimit)(this._config.transactionMaxFee, options), "transaction");
|
|
1155
1155
|
return built.hex;
|
|
1156
1156
|
}
|
|
@@ -1168,7 +1168,7 @@ var WalletAccountZcash = class _WalletAccountZcash extends WalletAccountReadOnly
|
|
|
1168
1168
|
hash = txid(parsed);
|
|
1169
1169
|
fee = desc.fee;
|
|
1170
1170
|
} else {
|
|
1171
|
-
const built = await this.
|
|
1171
|
+
const built = await this.signSpend(tx);
|
|
1172
1172
|
rawHex = built.hex;
|
|
1173
1173
|
hash = built.txid;
|
|
1174
1174
|
fee = built.fee;
|
|
@@ -1182,7 +1182,7 @@ var WalletAccountZcash = class _WalletAccountZcash extends WalletAccountReadOnly
|
|
|
1182
1182
|
if (o.token) throw new Error("Tokens are not supported on the zcash blockchain.");
|
|
1183
1183
|
this.live();
|
|
1184
1184
|
const client = this.requireClient("transfer");
|
|
1185
|
-
const built = await this.
|
|
1185
|
+
const built = await this.signSpend({ to: o.recipient, value: o.amount });
|
|
1186
1186
|
this.checkMax(built.fee, (0, import_core7.feeLimit)(this._config.transferMaxFee, writeOptions), "transfer");
|
|
1187
1187
|
const id = await client.broadcast(built.hex);
|
|
1188
1188
|
return { hash: id || built.txid, fee: built.fee };
|