@fuel-ts/account 0.0.0-rc-1815-20240322131329 → 0.0.0-rc-1832-20240322144804
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.
Potentially problematic release.
This version of @fuel-ts/account might be problematic. Click here for more details.
- package/dist/account.d.ts +0 -7
- package/dist/account.d.ts.map +1 -1
- package/dist/connectors/fuel-connector.d.ts +0 -10
- package/dist/connectors/fuel-connector.d.ts.map +1 -1
- package/dist/index.global.js +78 -91
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +6 -66
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -66
- package/dist/index.mjs.map +1 -1
- package/dist/providers/provider.d.ts +2 -3
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +1 -20
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/test-utils.global.js +78 -79
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +6 -54
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +6 -54
- package/dist/test-utils.mjs.map +1 -1
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
- package/package.json +16 -16
package/dist/test-utils.mjs
CHANGED
@@ -1624,27 +1624,13 @@ var BaseTransactionRequest = class {
|
|
1624
1624
|
this.outputs.push(output);
|
1625
1625
|
return this.outputs.length - 1;
|
1626
1626
|
}
|
1627
|
-
/**
|
1628
|
-
* @hidden
|
1629
|
-
*
|
1630
|
-
* Pushes a witness to the list and returns the index
|
1631
|
-
*
|
1632
|
-
* @param signature - The signature to add to the witness.
|
1633
|
-
* @returns The index of the created witness.
|
1634
|
-
*/
|
1635
|
-
addWitness(signature) {
|
1636
|
-
this.witnesses.push(signature);
|
1637
|
-
return this.witnesses.length - 1;
|
1638
|
-
}
|
1639
1627
|
/**
|
1640
1628
|
* @hidden
|
1641
1629
|
*
|
1642
1630
|
* Creates an empty witness without any side effects and returns the index
|
1643
|
-
*
|
1644
|
-
* @returns The index of the created witness.
|
1645
1631
|
*/
|
1646
|
-
|
1647
|
-
this.
|
1632
|
+
createWitness() {
|
1633
|
+
this.witnesses.push(concat([ZeroBytes324, ZeroBytes324]));
|
1648
1634
|
return this.witnesses.length - 1;
|
1649
1635
|
}
|
1650
1636
|
/**
|
@@ -1673,21 +1659,6 @@ var BaseTransactionRequest = class {
|
|
1673
1659
|
}
|
1674
1660
|
this.witnesses[index] = witness;
|
1675
1661
|
}
|
1676
|
-
/**
|
1677
|
-
* Helper function to add an external signature to the transaction.
|
1678
|
-
*
|
1679
|
-
* @param account - The account/s to sign to the transaction.
|
1680
|
-
* @returns The transaction with the signature witness added.
|
1681
|
-
*/
|
1682
|
-
async addAccountWitnesses(account) {
|
1683
|
-
const accounts = Array.isArray(account) ? account : [account];
|
1684
|
-
await Promise.all(
|
1685
|
-
accounts.map(async (acc) => {
|
1686
|
-
this.addWitness(await acc.signTransaction(this));
|
1687
|
-
})
|
1688
|
-
);
|
1689
|
-
return this;
|
1690
|
-
}
|
1691
1662
|
/**
|
1692
1663
|
* Gets the coin inputs for a transaction.
|
1693
1664
|
*
|
@@ -1753,7 +1724,7 @@ var BaseTransactionRequest = class {
|
|
1753
1724
|
} else {
|
1754
1725
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
|
1755
1726
|
if (typeof witnessIndex !== "number") {
|
1756
|
-
witnessIndex = this.
|
1727
|
+
witnessIndex = this.createWitness();
|
1757
1728
|
}
|
1758
1729
|
}
|
1759
1730
|
const input = {
|
@@ -1787,7 +1758,7 @@ var BaseTransactionRequest = class {
|
|
1787
1758
|
} else {
|
1788
1759
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
|
1789
1760
|
if (typeof witnessIndex !== "number") {
|
1790
|
-
witnessIndex = this.
|
1761
|
+
witnessIndex = this.createWitness();
|
1791
1762
|
}
|
1792
1763
|
}
|
1793
1764
|
const input = {
|
@@ -3814,8 +3785,7 @@ var _Provider = class {
|
|
3814
3785
|
async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
|
3815
3786
|
estimateTxDependencies = true,
|
3816
3787
|
estimatePredicates = true,
|
3817
|
-
resourcesOwner
|
3818
|
-
signatureCallback
|
3788
|
+
resourcesOwner
|
3819
3789
|
} = {}) {
|
3820
3790
|
const txRequestClone = clone3(transactionRequestify(transactionRequestLike));
|
3821
3791
|
const chainInfo = this.getChain();
|
@@ -3834,9 +3804,6 @@ var _Provider = class {
|
|
3834
3804
|
}
|
3835
3805
|
await this.estimatePredicates(txRequestClone);
|
3836
3806
|
}
|
3837
|
-
if (signatureCallback && isScriptTransaction) {
|
3838
|
-
await signatureCallback(txRequestClone);
|
3839
|
-
}
|
3840
3807
|
const minGas = txRequestClone.calculateMinGas(chainInfo);
|
3841
3808
|
const maxGas = txRequestClone.calculateMaxGas(chainInfo, minGas);
|
3842
3809
|
let receipts = [];
|
@@ -4718,21 +4685,6 @@ var Account = class extends AbstractAccount {
|
|
4718
4685
|
}
|
4719
4686
|
return this._connector.signMessage(this.address.toString(), message);
|
4720
4687
|
}
|
4721
|
-
/**
|
4722
|
-
* Signs a transaction with the wallet's private key.
|
4723
|
-
*
|
4724
|
-
* @param transactionRequestLike - The transaction request to sign.
|
4725
|
-
* @returns A promise that resolves to the signature of the transaction.
|
4726
|
-
*/
|
4727
|
-
async signTransaction(transactionRequestLike) {
|
4728
|
-
if (!this._connector) {
|
4729
|
-
throw new FuelError14(
|
4730
|
-
ErrorCode14.MISSING_CONNECTOR,
|
4731
|
-
"A connector is required to sign transactions."
|
4732
|
-
);
|
4733
|
-
}
|
4734
|
-
return this._connector.signTransaction(this.address.toString(), transactionRequestLike);
|
4735
|
-
}
|
4736
4688
|
/**
|
4737
4689
|
* Sends a transaction to the network.
|
4738
4690
|
*
|
@@ -5047,7 +4999,7 @@ var BaseWalletUnlocked = class extends Account {
|
|
5047
4999
|
*/
|
5048
5000
|
async signTransaction(transactionRequestLike) {
|
5049
5001
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
5050
|
-
const chainId = this.provider.
|
5002
|
+
const chainId = this.provider.getChain().consensusParameters.chainId.toNumber();
|
5051
5003
|
const hashedTransaction = transactionRequest.getTransactionId(chainId);
|
5052
5004
|
const signature = await this.signer().sign(hashedTransaction);
|
5053
5005
|
return hexlify15(signature);
|