Skip to content

Commit 6001bb6

Browse files
committed
update examples
1 parent 59e5eb5 commit 6001bb6

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const stopBlockNum = "+10";
4444
const substreams = new Substreams(outputModule, {
4545
startBlockNum,
4646
stopBlockNum,
47-
authorization: process.env.SUBSTREAMS_API_TOKEN
47+
authorization: process.env.STREAMINGFAST_KEY // or SUBSTREAMS_API_TOKEN
4848
});
4949

5050
(async () => {

example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const stopBlockNum = "+10";
1010
const substreams = new Substreams(outputModule, {
1111
startBlockNum,
1212
stopBlockNum,
13-
authorization: "<STREAMINGFAST_KEY or SUBSTREAMS_API_TOKEN>"
13+
authorization: process.env.STREAMINGFAST_KEY // or SUBSTREAMS_API_TOKEN
1414
});
1515

1616
(async () => {

examples/subtivity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const stopBlockNum = "+10";
1010
const substreams = new Substreams(outputModule, {
1111
startBlockNum,
1212
stopBlockNum,
13-
authorization: process.env.STREAMINGFAST_KEY
13+
authorization: process.env.STREAMINGFAST_KEY // or SUBSTREAMS_API_TOKEN
1414
});
1515

1616
(async () => {

src/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ export async function authentication_token(api_key: string) {
4646

4747
export async function parseAuthorization(authorization: string ) {
4848
if ( authorization.includes("server_") ) {
49-
return (await authentication_token(authorization)).token;
49+
const { token } = await authentication_token(authorization);
50+
return token;
5051
}
5152
return authorization;
5253
}

0 commit comments

Comments
 (0)