Skip to content

Instantly share code, notes, and snippets.

@0xTranqui
Last active April 1, 2024 19:32
Show Gist options
  • Save 0xTranqui/7e9f19aee739395215984f138207c9ee to your computer and use it in GitHub Desktop.
Save 0xTranqui/7e9f19aee739395215984f138207c9ee to your computer and use it in GitHub Desktop.
syndicate config idea
/*
the general idea for this is, we should only ever have to worry about setting up the config/client correctly once.
and it should happen in this file. if you do it right, then it can be exported and accessed anywhere else. if the config
isnt set up correctly (missing envs, missing/broken endpoints, etc), then wherever you import it into, will simply
not be able to reference it because it will be null. and so each place u import it can just check for it being null or not.
if its not null, you know everything is working as intended
*/
const projectId = process.env.SYNDICATE_PROJECT_ID_POSTGATEWAY
const apiKey = process.env.SYNDICATE_API_KEY
export const syndicateClient = !projectId || !apiKey ? null : {
officialActions: new Syndicate() // "officialActions" is mid name but meant to represent what comes out standard
projectId: projectId,
generatePostTxnInput: func(),
generatePostBatchTxnInput: func()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment