Skip to content

Commit

Permalink
Merge branch 'master' into portal-api
Browse files Browse the repository at this point in the history
  • Loading branch information
belopash committed Jan 24, 2025
2 parents a467512 + 0dac2a8 commit 6169159
Show file tree
Hide file tree
Showing 31 changed files with 268 additions and 82 deletions.
10 changes: 0 additions & 10 deletions common/changes/@subsquid/borsh/master_2024-12-20-16-49.json

This file was deleted.

10 changes: 0 additions & 10 deletions common/changes/@subsquid/solana-dump/master_2024-12-20-16-49.json

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions common/changes/@subsquid/solana-rpc/master_2024-12-20-16-49.json

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 12 additions & 0 deletions solana/borsh/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@subsquid/borsh",
"entries": [
{
"version": "0.2.0",
"tag": "@subsquid/borsh_v0.2.0",
"date": "Wed, 15 Jan 2025 18:59:13 GMT",
"comments": {
"minor": [
{
"comment": "implement HashMap and HashSet codecs"
}
]
}
},
{
"version": "0.1.0",
"tag": "@subsquid/borsh_v0.1.0",
Expand Down
9 changes: 8 additions & 1 deletion solana/borsh/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @subsquid/borsh

This log was last generated on Tue, 07 May 2024 07:40:43 GMT and should not be manually modified.
This log was last generated on Wed, 15 Jan 2025 18:59:13 GMT and should not be manually modified.

## 0.2.0
Wed, 15 Jan 2025 18:59:13 GMT

### Minor changes

- implement HashMap and HashSet codecs

## 0.1.0
Tue, 07 May 2024 07:40:43 GMT
Expand Down
2 changes: 1 addition & 1 deletion solana/borsh/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@subsquid/borsh",
"version": "0.1.0",
"version": "0.2.0",
"description": "Borsh encoder/decoder",
"license": "GPL-3.0-or-later",
"repository": "[email protected]:subsquid/squid.git",
Expand Down
27 changes: 27 additions & 0 deletions solana/borsh/src/codecs/hash-map.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {Codec} from '../codec'
import {Sink} from '../sink'
import {Src} from '../src'


export class HashMapCodec<K, V> implements Codec<Map<K, V>> {
constructor(public readonly key: Codec<K>, public readonly value: Codec<V>) {}

encode(sink: Sink, val: Map<K, V>): void {
sink.u32(val.size)
for (let [key, value] of val) {
this.key.encode(sink, key)
this.value.encode(sink, value)
}
}

decode(src: Src): Map<K, V> {
let len = src.u32()
let res = new Map<K, V>()
for (let i = 0; i < len; i++) {
let key = this.key.decode(src)
let value = this.value.decode(src)
res.set(key, value)
}
return res
}
}
25 changes: 25 additions & 0 deletions solana/borsh/src/codecs/hash-set.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {Codec} from '../codec'
import {Sink} from '../sink'
import {Src} from '../src'


export class HashSetCodec<T> implements Codec<Set<T>> {
constructor(public readonly item: Codec<T>) {}

encode(sink: Sink, val: Set<T>): void {
sink.u32(val.size)
for (let value of val) {
this.item.encode(sink, value)
}
}

decode(src: Src): Set<T> {
let len = src.u32()
let res = new Set<T>()
for (let i = 0; i < len; i++) {
let value = this.item.decode(src)
res.add(value)
}
return res
}
}
14 changes: 14 additions & 0 deletions solana/borsh/src/dsl.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {Codec, GetCodecType} from './codec'
import {ArrayCodec, FixedArrayCodec} from './codecs/array'
import {SumCodec, Variant} from './codecs/enum'
import {HashMapCodec} from './codecs/hash-map'
import {HashSetCodec} from './codecs/hash-set'
import {OptionCodec} from './codecs/option'
import {RefCodec} from './codecs/ref'
import {GetStructType, StructCodec} from './codecs/struct'
Expand Down Expand Up @@ -29,6 +31,7 @@ export function struct<Props extends Record<string, Codec<any>>>(
return new StructCodec(props as any)
}


export function tuple(tuple: []): TupleCodec<[]>
export function tuple<T>(tuple: [T]): TupleCodec<GetTupleType<[T]>>
export function tuple<T1, T2>(tuple: [T1, T2]): TupleCodec<GetTupleType<[T1, T2]>>
Expand All @@ -43,6 +46,17 @@ export function tuple<T extends any[]>(tuple: T): TupleCodec<T> {
return new TupleCodec(tuple as any)
}


export function hashMap<KC extends Codec<any>, VC extends Codec<any>>(key: KC, value: VC): HashMapCodec<GetCodecType<KC>, GetCodecType<VC>> {
return new HashMapCodec(key, value)
}


export function hashSet<IC extends Codec<any>>(item: IC): HashSetCodec<GetCodecType<IC>> {
return new HashSetCodec(item)
}


export function option<IC extends Codec<any>>(item: IC): OptionCodec<GetCodecType<IC>> {
return new OptionCodec(item)
}
Expand Down
12 changes: 12 additions & 0 deletions solana/solana-dump/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@subsquid/solana-dump",
"entries": [
{
"version": "0.0.8",
"tag": "@subsquid/solana-dump_v0.0.8",
"date": "Wed, 15 Jan 2025 18:59:13 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@subsquid/solana-rpc\" from `^0.0.3` to `0.0.4`"
}
]
}
},
{
"version": "0.0.7",
"tag": "@subsquid/solana-dump_v0.0.7",
Expand Down
7 changes: 6 additions & 1 deletion solana/solana-dump/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @subsquid/solana-dump

This log was last generated on Tue, 03 Dec 2024 11:47:42 GMT and should not be manually modified.
This log was last generated on Wed, 15 Jan 2025 18:59:13 GMT and should not be manually modified.

## 0.0.8
Wed, 15 Jan 2025 18:59:13 GMT

_Version update only_

## 0.0.7
Tue, 03 Dec 2024 11:47:42 GMT
Expand Down
4 changes: 2 additions & 2 deletions solana/solana-dump/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@subsquid/solana-dump",
"version": "0.0.7",
"version": "0.0.8",
"description": "Data archiving tool for Solana",
"license": "GPL-3.0-or-later",
"repository": "[email protected]:subsquid/squid.git",
Expand All @@ -20,7 +20,7 @@
},
"dependencies": {
"@subsquid/rpc-client": "^4.11.0",
"@subsquid/solana-rpc": "^0.0.3",
"@subsquid/solana-rpc": "^0.0.4",
"@subsquid/util-internal": "^3.2.0",
"@subsquid/util-internal-dump-cli": "^1.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions solana/solana-objects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"@subsquid/util-internal": "^3.2.0"
},
"peerDependencies": {
"@subsquid/solana-stream": "^0.1.2"
"@subsquid/solana-stream": "^0.1.3"
},
"devDependencies": {
"@subsquid/solana-stream": "^0.1.2",
"@subsquid/solana-stream": "^0.1.3",
"@types/node": "^18.18.14",
"typescript": "~5.5.4"
}
Expand Down
12 changes: 12 additions & 0 deletions solana/solana-rpc/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@subsquid/solana-rpc",
"entries": [
{
"version": "0.0.4",
"tag": "@subsquid/solana-rpc_v0.0.4",
"date": "Wed, 15 Jan 2025 18:59:13 GMT",
"comments": {
"patch": [
{
"comment": "fixed the polling logic error that led to processor crashes at chain head"
}
]
}
},
{
"version": "0.0.3",
"tag": "@subsquid/solana-rpc_v0.0.3",
Expand Down
9 changes: 8 additions & 1 deletion solana/solana-rpc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @subsquid/solana-rpc

This log was last generated on Tue, 03 Dec 2024 11:47:42 GMT and should not be manually modified.
This log was last generated on Wed, 15 Jan 2025 18:59:13 GMT and should not be manually modified.

## 0.0.4
Wed, 15 Jan 2025 18:59:13 GMT

### Patches

- fixed the polling logic error that led to processor crashes at chain head

## 0.0.3
Tue, 03 Dec 2024 11:47:42 GMT
Expand Down
2 changes: 1 addition & 1 deletion solana/solana-rpc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@subsquid/solana-rpc",
"version": "0.0.3",
"version": "0.0.4",
"description": "Solana RPC data ingestion tools",
"license": "GPL-3.0-or-later",
"repository": "[email protected]:subsquid/squid.git",
Expand Down
12 changes: 12 additions & 0 deletions solana/solana-stream/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@subsquid/solana-stream",
"entries": [
{
"version": "0.1.3",
"tag": "@subsquid/solana-stream_v0.1.3",
"date": "Wed, 15 Jan 2025 18:59:13 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@subsquid/solana-rpc\" from `^0.0.3` to `0.0.4`"
}
]
}
},
{
"version": "0.1.2",
"tag": "@subsquid/solana-stream_v0.1.2",
Expand Down
7 changes: 6 additions & 1 deletion solana/solana-stream/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @subsquid/solana-stream

This log was last generated on Tue, 03 Dec 2024 11:47:42 GMT and should not be manually modified.
This log was last generated on Wed, 15 Jan 2025 18:59:13 GMT and should not be manually modified.

## 0.1.3
Wed, 15 Jan 2025 18:59:13 GMT

_Version update only_

## 0.1.2
Tue, 03 Dec 2024 11:47:42 GMT
Expand Down
4 changes: 2 additions & 2 deletions solana/solana-stream/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@subsquid/solana-stream",
"version": "0.1.2",
"version": "0.1.3",
"description": "Solana block data streamer",
"license": "GPL-3.0-or-later",
"repository": "[email protected]:subsquid/squid.git",
Expand All @@ -20,7 +20,7 @@
"@subsquid/logger": "^1.3.3",
"@subsquid/rpc-client": "^4.11.0",
"@subsquid/solana-normalization": "^0.0.3",
"@subsquid/solana-rpc": "^0.0.3",
"@subsquid/solana-rpc": "^0.0.4",
"@subsquid/solana-rpc-data": "^0.0.3",
"@subsquid/util-internal": "^3.2.0",
"@subsquid/util-internal-archive-client": "^0.1.2",
Expand Down
20 changes: 20 additions & 0 deletions solana/solana-typegen/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
{
"name": "@subsquid/solana-typegen",
"entries": [
{
"version": "0.4.0",
"tag": "@subsquid/solana-typegen_v0.4.0",
"date": "Wed, 15 Jan 2025 18:59:13 GMT",
"comments": {
"minor": [
{
"comment": "add HashMap and HashSet types support"
}
],
"dependency": [
{
"comment": "Updating dependency \"@subsquid/borsh\" from `^0.1.0` to `0.2.0`"
},
{
"comment": "Updating dependency \"@subsquid/solana-stream\" from `^0.1.2` to `0.1.3`"
}
]
}
},
{
"version": "0.3.0",
"tag": "@subsquid/solana-typegen_v0.3.0",
Expand Down
9 changes: 8 additions & 1 deletion solana/solana-typegen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @subsquid/solana-typegen

This log was last generated on Mon, 23 Sep 2024 17:53:43 GMT and should not be manually modified.
This log was last generated on Wed, 15 Jan 2025 18:59:13 GMT and should not be manually modified.

## 0.4.0
Wed, 15 Jan 2025 18:59:13 GMT

### Minor changes

- add HashMap and HashSet types support

## 0.3.0
Mon, 23 Sep 2024 17:53:43 GMT
Expand Down
Loading

0 comments on commit 6169159

Please sign in to comment.