-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'db/docs/tx-speed' into aa/docs/tx-speed-touchups
- Loading branch information
Showing
51 changed files
with
1,419 additions
and
3,587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@fuel-ts/account": minor | ||
"@fuel-ts/program": minor | ||
"@fuel-ts/script": patch | ||
--- | ||
|
||
docs!: optimizing frontend apps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@fuel-ts/account": patch | ||
--- | ||
|
||
feat: added `onBeforeSend` hook to the connector interface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"fuels": patch | ||
--- | ||
|
||
fix: usage of `providerUrl` in `fuels dev` command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
--- | ||
|
||
chore: add script for network testing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@fuel-ts/account": minor | ||
"@fuel-ts/errors": patch | ||
--- | ||
|
||
feat!: prevent implicit asset burn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@fuel-ts/contract": patch | ||
"@fuel-ts/crypto": patch | ||
"fuels": patch | ||
"create-fuels": patch | ||
"@fuel-ts/script": patch | ||
--- | ||
|
||
chore: remove unused deps + update knip config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
DEVNET_WALLET_PVT_KEY= | ||
TESTNET_WALLET_PVT_KEY= | ||
PUBLISHED_NPM_TAG= | ||
PUBLISHED_NPM_TAG= | ||
NETWORK_TEST_URL= | ||
NETWORK_TEST_PVT_KEY= |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
* @digorithm @arboleya @Torres-ssf @danielbate @nedsalk @petertonysmith94 @maschad | ||
* @digorithm @arboleya @Torres-ssf @danielbate @nedsalk @petertonysmith94 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
apps/docs/src/guide/transactions/snippets/transaction-request/asset-burn.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { InputType, Provider, ScriptTransactionRequest, Wallet } from 'fuels'; | ||
import { ASSET_A } from 'fuels/test-utils'; | ||
|
||
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../../env'; | ||
|
||
const provider = new Provider(LOCAL_NETWORK_URL); | ||
const sender = Wallet.fromPrivateKey(WALLET_PVT_KEY, provider); | ||
|
||
// #region asset-burn | ||
const transactionRequest = new ScriptTransactionRequest(); | ||
|
||
const { | ||
coins: [coin], | ||
} = await sender.getCoins(ASSET_A); | ||
|
||
// Add the coin as an input, without a change output | ||
transactionRequest.inputs.push({ | ||
id: coin.id, | ||
type: InputType.Coin, | ||
owner: coin.owner.toB256(), | ||
amount: coin.amount, | ||
assetId: coin.assetId, | ||
txPointer: '0x00000000000000000000000000000000', | ||
witnessIndex: | ||
transactionRequest.getCoinInputWitnessIndexByOwner(coin.owner) ?? | ||
transactionRequest.addEmptyWitness(), | ||
}); | ||
|
||
// Fund the transaction | ||
await transactionRequest.estimateAndFund(sender); | ||
|
||
// Send the transaction with asset burn enabled | ||
const tx = await sender.sendTransaction(transactionRequest, { | ||
enableAssetBurn: true, | ||
}); | ||
// #endregion asset-burn | ||
|
||
const { isStatusSuccess } = await tx.waitForResult(); | ||
console.log('Transaction should have been successful', isStatusSuccess); |
Oops, something went wrong.