-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(changesets): versioning packages (#742)
* ci(scripts): update docs * ci(changesets): versioning packages --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
1f79f79
commit 9e9e356
Showing
129 changed files
with
1,363 additions
and
351 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# generated-file | ||
fuels: 0.29.1 | ||
fuels: 0.30.0 | ||
fuel-core: 0.15.1 | ||
sway: 0.32.2 | ||
forc: 0.32.2 |
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 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,24 @@ | ||
--- | ||
title: "Getting A Message Proof" | ||
parent: "Messages" | ||
grand_parent: "Guide" | ||
--- | ||
|
||
[info]: this file is autogenerated | ||
# Getting a Message Proof | ||
|
||
A message proof is a cryptographic proof that a message was included in a block. You can use the `getMessageProof` method to retrieve a message proof for a given transaction ID and message ID. | ||
|
||
|
||
```typescript | ||
const result = await tx.wait(); | ||
const messageOutReceipt = <TransactionResultMessageOutReceipt>result.receipts[0]; | ||
const messageProof = await provider.getMessageProof( | ||
TRANSACTION_ID, | ||
messageOutReceipt.messageID | ||
); | ||
``` | ||
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/wallet/src/transfer.test.ts#L169-L176) | ||
|
||
--- | ||
|
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,28 @@ | ||
--- | ||
title: "Getting All Resources" | ||
parent: "Messages" | ||
grand_parent: "Guide" | ||
--- | ||
|
||
[info]: this file is autogenerated | ||
# Getting All Resources | ||
|
||
You can use the `getResourcesToSpend` method to retrieve a list of all the resources (coins + assets) that can be spent by a given address. | ||
|
||
|
||
```typescript | ||
const walletLocked = Wallet.fromAddress( | ||
'0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db' | ||
); | ||
const resourcesToSpend = await walletLocked.getResourcesToSpend([ | ||
{ | ||
amount: bn(2), | ||
assetId: '0x0101010101010101010101010101010101010101010101010101010101010101', | ||
}, | ||
]); | ||
expect(resourcesToSpend[0].amount.gt(2)).toBeTruthy(); | ||
``` | ||
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/wallet/src/wallet-locked.test.ts#L38-L49) | ||
|
||
--- | ||
|
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,57 @@ | ||
--- | ||
title: "Getting Messages" | ||
parent: "Messages" | ||
grand_parent: "Guide" | ||
--- | ||
|
||
[info]: this file is autogenerated | ||
# Getting Messages | ||
|
||
You can use the `getMessages` method to retrieve a list of messages from the blockchain. | ||
|
||
|
||
```typescript | ||
const WALLET_A = Wallet.fromPrivateKey( | ||
'0x1ff16505df75735a5bcf4cb4cf839903120c181dd9be6781b82cda23543bd242', | ||
provider | ||
); | ||
const WALLET_B = Wallet.fromPrivateKey( | ||
'0x30bb0bc68f5d2ec3b523cee5a65503031b40679d9c72280cd8088c2cfbc34e38', | ||
provider | ||
); | ||
|
||
const EXPECTED_MESSAGES_A: Message[] = [ | ||
{ | ||
sender: WALLET_B.address, | ||
recipient: WALLET_A.address, | ||
nonce: bn(1), | ||
amount: bn(1), | ||
data: arrayify( | ||
'0x00000000000000080000000000000007000000000000000600000000000000050000000000000004' | ||
), | ||
daHeight: bn(0), | ||
fuelBlockSpend: bn(0), | ||
}, | ||
]; | ||
const EXPECTED_MESSAGES_B: Message[] = [ | ||
{ | ||
sender: WALLET_A.address, | ||
recipient: WALLET_B.address, | ||
nonce: bn('1017517292834129547'), | ||
amount: bn('12704439083013451934'), | ||
data: arrayify('0x0000000000000007'), | ||
daHeight: bn('3684546456337077810'), | ||
fuelBlockSpend: bn(0), | ||
}, | ||
]; | ||
|
||
const aMessages = await WALLET_A.getMessages(); | ||
const bMessages = await WALLET_B.getMessages(); | ||
|
||
expect(aMessages).toStrictEqual(EXPECTED_MESSAGES_A); | ||
expect(bMessages).toStrictEqual(EXPECTED_MESSAGES_B); | ||
``` | ||
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/coverage-contract.test.ts#L369-L409) | ||
|
||
--- | ||
|
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,36 @@ | ||
--- | ||
title: "Messages" | ||
parent: "Guide" | ||
has_children: true | ||
has_toc: false | ||
nav_order: 9 | ||
--- | ||
|
||
[info]: this file is autogenerated | ||
|
||
|
||
# Messages | ||
|
||
A message is an object that contains some data that when broadcasted to the network, can change the state of the blockchain. This can include sending tokens, creating a new account, or deploying a smart contract. Messages are signed by a sender and broadcasted to the network. This message is then verified and included in a block. | ||
|
||
This is the general structure of a `Message` object: | ||
|
||
|
||
```typescript | ||
/** | ||
* A Fuel message | ||
*/ | ||
export type Message = { | ||
sender: AbstractAddress; | ||
recipient: AbstractAddress; | ||
nonce: BN; | ||
amount: BN; | ||
data: BytesLike; | ||
daHeight: BN; | ||
fuelBlockSpend: BN; | ||
}; | ||
``` | ||
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/providers/src/message.ts#L5-L18) | ||
|
||
--- | ||
|
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
Oops, something went wrong.