Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions base_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,37 @@ func (p *BaseConversationState) IsChainTestnet() bool {
func (c *BaseConversationState) IsValidChainInput(input string) bool {
return networks.GetSubstreamsRegistry().Find(input) != nil
}

// GetPackageURL generates a probable GitHub URL for the project based on the project name and chain.
// Returns a URL in the format: https://github.com/username/{Name}-{ChainName}
// The 'username' is a placeholder that users should update with their actual GitHub username or organization.
func (p *BaseConversationState) GetPackageURL() string {
if p.Name == "" {
return ""
}

chainSuffix := ""
if p.ChainName != "" {
chainSuffix = "-" + p.ChainName
}

return "https://github.com/username/" + p.Name + chainSuffix
}

// GetPackageDescription generates a description for the package based on the project name and chain.
// Returns a description using the Name field and ChainDisplayName() method result.
// Example: "Substreams module for my-project on Ethereum Mainnet"
func (p *BaseConversationState) GetPackageDescription() string {
if p.Name == "" {
return "Substreams module"
}

desc := "Substreams module for " + p.Name

chainDisplay := p.ChainDisplayName()
if chainDisplay != "" {
desc += " on " + chainDisplay
}

return desc
}
2 changes: 2 additions & 0 deletions evm-events-calls-raw/templates/sql/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .GetModuleName }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
sql: https://github.com/streamingfast/substreams-sink-sql/releases/download/protodefs-v{{ .SQLImportVersion }}/substreams-sink-sql-protodefs-v{{ .SQLImportVersion }}.spkg
Expand Down
2 changes: 2 additions & 0 deletions evm-events-calls-raw/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .GetModuleName }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
ethcommon: https://spkg.io/streamingfast/ethereum-common-v0.3.3.spkg
Expand Down
2 changes: 2 additions & 0 deletions evm-events-calls/templates/sql/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .GetModuleName }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
sql: https://github.com/streamingfast/substreams-sink-sql/releases/download/protodefs-v{{ .SQLImportVersion }}/substreams-sink-sql-protodefs-v{{ .SQLImportVersion }}.spkg
Expand Down
2 changes: 2 additions & 0 deletions evm-events-calls/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .GetModuleName }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
ethcommon: https://spkg.io/streamingfast/ethereum-common-v0.3.3.spkg
Expand Down
2 changes: 2 additions & 0 deletions evm-hello-world/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .GetModuleName }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

protobuf:
files:
Expand Down
2 changes: 2 additions & 0 deletions injective-events/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .Name }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
injective: https://github.com/streamingfast/substreams-foundational-modules/releases/download/injective-common-v0.2.5/injective-common-v0.2.5.spkg
Expand Down
2 changes: 2 additions & 0 deletions injective-hello-world/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .GetModuleName }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
cosmos: https://github.com/streamingfast/substreams-cosmos/releases/download/v0.1.5/cosmos-v0.1.5.spkg
Expand Down
2 changes: 2 additions & 0 deletions mantra-events/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .Name }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
mantra: https://spkg.io/streamingfast/mantra-common-v0.1.1.spkg
Expand Down
2 changes: 2 additions & 0 deletions mantra-hello-world/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .GetModuleName }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
cosmos: https://github.com/streamingfast/substreams-cosmos/releases/download/v0.1.5/cosmos-v0.1.5.spkg
Expand Down
2 changes: 2 additions & 0 deletions near-hello-world/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: my_project
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

protobuf:
files:
Expand Down
2 changes: 2 additions & 0 deletions sol-anchor/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .GetModuleName }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
solana: https://spkg.io/streamingfast/solana-common-v0.3.3.spkg
Expand Down
2 changes: 2 additions & 0 deletions sol-hello-world/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .GetModuleName }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
solana: https://spkg.io/streamingfast/solana-common-v0.3.3.spkg
Expand Down
2 changes: 2 additions & 0 deletions sol-transactions/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .Name }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
solana: https://spkg.io/streamingfast/solana-common-v0.3.3.spkg
Expand Down
2 changes: 2 additions & 0 deletions starknet-events/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .Name }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
starknet: https://spkg.io/streamingfast/starknet-foundational-v0.1.4.spkg
Expand Down
2 changes: 2 additions & 0 deletions starknet-hello-world/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .GetModuleName }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
starknet: https://spkg.io/streamingfast/starknet-foundational-v0.1.4.spkg
Expand Down
2 changes: 2 additions & 0 deletions stellar-minimal/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .GetModuleName }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
stellar: https://github.com/streamingfast/substreams-foundational-modules/releases/download/stellar-foundational-v0.5.0/stellar-foundational-v0.5.0.spkg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .GetModuleName }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
stellar: [email protected]
Expand Down
2 changes: 2 additions & 0 deletions tron-hello-world/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: my_project
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
tron: https://spkg.io/v1/packages/tron_foundational/v0.1.2 # Input the Tron foundational modules (which allow you to filter on trasanctions)
Expand Down
2 changes: 2 additions & 0 deletions tron-transactions/templates/substreams.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ specVersion: v0.1.0
package:
name: {{ .GetModuleName }}
version: v0.1.0
url: {{ .GetPackageURL }}
description: {{ .GetPackageDescription }}

imports:
tron: https://spkg.io/v1/packages/tron_foundational/v0.1.2
Expand Down
Loading