Add python example for websocket api docs

This commit is contained in:
hunicus 2022-09-13 06:44:34 -04:00
parent 0a645431ae
commit fc57effd5c
No known key found for this signature in database
GPG key ID: 24837C51B6D81FD9
3 changed files with 45 additions and 0 deletions

View file

@ -287,6 +287,10 @@ yarn add @mempool/liquid.js`;
return code.codeSampleMainnet.response;
}
wrapPythonTemplate(code: any) {
return ( ( this.network === 'testnet' || this.network === 'signet' ) ? ( code.codeTemplate.python.replace( "wss://mempool.space/api/v1/ws", "wss://mempool.space/" + this.network + "/api/v1/ws" ) ) : code.codeTemplate.python );
}
replaceJSPlaceholder(text: string, code: any) {
for (let index = 0; index < code.length; index++) {
const textReplace = code[index];