Skip to content

Commit

Permalink
Merge main into release
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jul 26, 2024
2 parents 1714989 + 1c0e5aa commit 965c95a
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 63 deletions.
38 changes: 10 additions & 28 deletions docs/code/interfaces/types_block.StateProof.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,21 @@

### P

**P**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `hsh` | \{ `t`: `number` } |
| `hsh.t` | `number` |
| `pth` | `Uint8Array`[] |
| `td` | `number` |
**P**: `Proof`

#### Defined in

[types/block.ts:272](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L272)
[types/block.ts:278](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L278)

___

### S

**S**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `hsh` | \{ `t`: `number` } |
| `hsh.t` | `number` |
| `pth` | `Uint8Array`[] |
| `td` | `number` |
**S**: `Proof`

#### Defined in

[types/block.ts:289](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L289)
[types/block.ts:295](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L295)

___

Expand All @@ -62,7 +44,7 @@ ___

#### Defined in

[types/block.ts:271](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L271)
[types/block.ts:277](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L277)

___

Expand All @@ -72,17 +54,17 @@ ___

#### Defined in

[types/block.ts:273](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L273)
[types/block.ts:279](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L279)

___

### r

**r**: `Map`\<`number`, \{ `p`: \{ `p`: \{ `cmt`: `Uint8Array` ; `lf`: `number` } ; `w`: `bigint` } ; `s`: \{ `l?`: `bigint` ; `s`: \{ `idx`: `number` ; `prf`: \{ `hsh`: \{ `t`: `number` } ; `pth`: `Uint8Array`[] ; `td`: `number` } ; `sig`: `Uint8Array` ; `vkey`: \{ `k`: `Uint8Array` } } } }\>
**r**: `Map`\<`number`, \{ `p`: \{ `p`: \{ `cmt`: `Uint8Array` ; `lf`: `number` } ; `w`: `bigint` } ; `s`: \{ `l?`: `bigint` ; `s`: \{ `idx`: `number` ; `prf`: `Proof` ; `sig`: `Uint8Array` ; `vkey`: \{ `k`: `Uint8Array` } } } }\>

#### Defined in

[types/block.ts:274](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L274)
[types/block.ts:280](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L280)

___

Expand All @@ -92,7 +74,7 @@ ___

#### Defined in

[types/block.ts:291](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L291)
[types/block.ts:297](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L297)

___

Expand All @@ -102,4 +84,4 @@ ___

#### Defined in

[types/block.ts:290](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L290)
[types/block.ts:296](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L296)
10 changes: 5 additions & 5 deletions docs/code/interfaces/types_block.StateProofMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#### Defined in

[types/block.ts:298](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L298)
[types/block.ts:304](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L304)

___

Expand All @@ -32,7 +32,7 @@ ___

#### Defined in

[types/block.ts:295](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L295)
[types/block.ts:301](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L301)

___

Expand All @@ -42,7 +42,7 @@ ___

#### Defined in

[types/block.ts:296](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L296)
[types/block.ts:302](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L302)

___

Expand All @@ -52,7 +52,7 @@ ___

#### Defined in

[types/block.ts:297](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L297)
[types/block.ts:303](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L303)

___

Expand All @@ -62,4 +62,4 @@ ___

#### Defined in

[types/block.ts:299](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L299)
[types/block.ts:305](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L305)
6 changes: 3 additions & 3 deletions docs/code/interfaces/types_block.StateProofTracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ StateProofNextRound is the next round for which we will accept a StateProof tran

#### Defined in

[types/block.ts:317](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L317)
[types/block.ts:323](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L323)

___

Expand All @@ -36,7 +36,7 @@ This is intended for computing the threshold of votes to expect from StateProofV

#### Defined in

[types/block.ts:313](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L313)
[types/block.ts:319](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L319)

___

Expand All @@ -51,4 +51,4 @@ For blocks that are not a multiple of ConsensusParams.StateProofRounds, this val

#### Defined in

[types/block.ts:308](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L308)
[types/block.ts:314](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L314)
36 changes: 18 additions & 18 deletions docs/code/interfaces/types_block.TransactionInBlock.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The asset close amount if the sender asset position was closed from this transac

#### Defined in

[types/block.ts:385](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L385)
[types/block.ts:391](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L391)

___

Expand All @@ -52,7 +52,7 @@ The block data for the transaction

#### Defined in

[types/block.ts:327](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L327)
[types/block.ts:333](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L333)

___

Expand All @@ -64,7 +64,7 @@ The ALGO close amount if the sender account was closed from this transaction.

#### Defined in

[types/block.ts:387](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L387)
[types/block.ts:393](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L393)

___

Expand All @@ -76,7 +76,7 @@ Rewards in microalgos applied to the close remainder to account.

#### Defined in

[types/block.ts:391](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L391)
[types/block.ts:397](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L397)

___

Expand All @@ -88,7 +88,7 @@ The app ID if an app was created from this transaction.

#### Defined in

[types/block.ts:383](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L383)
[types/block.ts:389](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L389)

___

Expand All @@ -100,7 +100,7 @@ The asset ID if an asset was created from this transaction.

#### Defined in

[types/block.ts:381](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L381)
[types/block.ts:387](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L387)

___

Expand All @@ -112,7 +112,7 @@ The binary genesis hash of the network the transaction is within.

#### Defined in

[types/block.ts:368](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L368)
[types/block.ts:374](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L374)

___

Expand All @@ -124,7 +124,7 @@ The string genesis ID of the network the transaction is within.

#### Defined in

[types/block.ts:370](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L370)
[types/block.ts:376](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L376)

___

Expand All @@ -136,7 +136,7 @@ Any logs that were issued as a result of this transaction.

#### Defined in

[types/block.ts:389](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L389)
[types/block.ts:395](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L395)

___

Expand All @@ -159,7 +159,7 @@ The offset within the parent transaction.

#### Defined in

[types/block.ts:366](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L366)
[types/block.ts:372](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L372)

___

Expand All @@ -171,7 +171,7 @@ The ID of the parent transaction if this is an inner transaction.

#### Defined in

[types/block.ts:354](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L354)
[types/block.ts:360](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L360)

___

Expand All @@ -183,7 +183,7 @@ Rewards in microalgos applied to the receiver account.

#### Defined in

[types/block.ts:395](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L395)
[types/block.ts:401](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L401)

___

Expand All @@ -206,7 +206,7 @@ The index within the block.txns array of this transaction or if it's an inner tr

#### Defined in

[types/block.ts:350](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L350)
[types/block.ts:356](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L356)

___

Expand All @@ -218,7 +218,7 @@ The round number of the block the transaction is within.

#### Defined in

[types/block.ts:372](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L372)
[types/block.ts:378](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L378)

___

Expand All @@ -241,7 +241,7 @@ The offset of the transaction within the round including inner transactions.

#### Defined in

[types/block.ts:338](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L338)
[types/block.ts:344](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L344)

___

Expand All @@ -253,7 +253,7 @@ The round unix timestamp of the block the transaction is within.

#### Defined in

[types/block.ts:374](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L374)
[types/block.ts:380](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L380)

___

Expand All @@ -265,7 +265,7 @@ Rewards in microalgos applied to the sender account.

#### Defined in

[types/block.ts:393](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L393)
[types/block.ts:399](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L399)

___

Expand All @@ -277,4 +277,4 @@ The transaction as an algosdk `Transaction` object.

#### Defined in

[types/block.ts:379](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L379)
[types/block.ts:385](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/block.ts#L385)
12 changes: 6 additions & 6 deletions src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ export function getIndexerTransactionFromAlgodTransaction(
'hash-factory': {
'hash-type': stateProof!.P.hsh.t,
},
'tree-depth': stateProof!.P.td,
path: stateProof!.P.pth.map((p) => Buffer.from(p).toString('base64')),
'tree-depth': stateProof!.P.td ?? 0,
path: stateProof!.P.pth?.map((p) => Buffer.from(p).toString('base64')) ?? [],
},
'positions-to-reveal': stateProof!.pr,
'salt-version': Number(stateProof!.v ?? 0),
Expand All @@ -435,8 +435,8 @@ export function getIndexerTransactionFromAlgodTransaction(
'hash-factory': {
'hash-type': stateProof!.S.hsh.t,
},
'tree-depth': stateProof!.S.td,
path: stateProof!.S.pth.map((p) => Buffer.from(p).toString('base64')),
'tree-depth': stateProof!.S.td ?? 0,
path: stateProof!.S.pth?.map((p) => Buffer.from(p).toString('base64')) ?? [],
},
'signed-weight': Number(stateProof!.w),
reveals: mapKeys(stateProof!.r).map((position) => {
Expand All @@ -451,8 +451,8 @@ export function getIndexerTransactionFromAlgodTransaction(
'hash-factory': {
'hash-type': r.s.s.prf.hsh.t,
},
'tree-depth': r.s.s.prf.td,
path: r.s.s.prf.pth.map((p) => Buffer.from(p).toString('base64')),
'tree-depth': r.s.s.prf.td ?? 0,
path: r.s.s.prf.pth?.map((p) => Buffer.from(p).toString('base64')) ?? [],
},
'verifying-key': Buffer.from(r.s.s.vkey.k).toString('base64'),
},
Expand Down
12 changes: 9 additions & 3 deletions src/types/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,16 @@ export interface BlockValueDelta {
ui?: number
}

interface Proof {
hsh: { t: number }
pth?: Uint8Array[]
td?: number
}

// https://github.com/algorand/go-algorand-sdk/blob/develop/types/stateproof.go
export interface StateProof {
c: Uint8Array
P: { hsh: { t: number }; pth: Uint8Array[]; td: number }
P: Proof
pr: number[]
r: Map<
number,
Expand All @@ -279,14 +285,14 @@ export interface StateProof {
l?: bigint
s: {
idx: number
prf: { hsh: { t: number }; pth: Uint8Array[]; td: number }
prf: Proof
sig: Uint8Array
vkey: { k: Uint8Array }
}
}
}
>
S: { hsh: { t: number }; pth: Uint8Array[]; td: number }
S: Proof
w: bigint
v?: number
}
Expand Down

0 comments on commit 965c95a

Please sign in to comment.