2021-12-01 17:01:50 -05:00
< ng-container * ngIf = "{ val: network$ | async } as network" >
< div class = "container-xl text-left" >
< div id = "restAPI" * ngIf = "restTabActivated" >
2021-12-17 07:00:48 -05:00
< div id = "doc-nav-desktop" class = "hide-on-mobile" [ ngClass ] = " desktopDocsNavPosition " >
2022-03-12 16:07:45 -05:00
< app-api-docs-nav ( navLinkClickEvent ) = " anchorLinkClick ( $ event ) " [ network ] = " { val: network $ | async } " > < / app-api-docs-nav >
2021-12-15 13:17:37 -05:00
< / div >
< div class = "doc-content" >
2021-12-17 07:00:48 -05:00
< p class = "hide-on-mobile no-bottom-space" > Reference for the {{ network.val === '' ? 'Bitcoin' : network.val.charAt(0).toUpperCase() + network.val.slice(1) }} < ng-container i18n = "api-docs.title" > API service< / ng-container > .< / p >
2021-12-16 18:24:26 -05:00
2022-02-07 13:25:36 -05:00
< div * ngFor = "let item of restDocs" >
2022-03-12 15:21:50 -05:00
< h3 * ngIf = "( item.type === 'category' ) && ( item.showConditions.indexOf(network.val) > -1 )" > {{ item.title }}< / h3 >
2022-02-07 13:25:36 -05:00
< div * ngIf = "( item.type !== 'category' ) && ( item.showConditions.indexOf(network.val) > -1 )" class = "endpoint-container" id = "{{ item.fragment }}" >
2022-03-12 16:07:45 -05:00
< a class = "section-header" ( click ) = " anchorLinkClick ( $ event ) " [ routerLink ] = " [ ' . / ' ] " fragment = "{{ item.fragment }}" > {{ item.title }} < span > {{ item.category }}< / span > < / a >
2022-03-12 15:21:50 -05:00
< div class = "endpoint-content" >
< div class = "endpoint" >
< div class = "subtitle" i18n = "Api docs endpoint" > Endpoint< / div >
< ng-container * ngIf = "item.httpRequestMethod === 'GET' && network.val === 'bisq' && item.codeExample.hasOwnProperty('bisq');else liquid_link_example" # bisq_link_example >
< a [ href ] = " wrapUrl ( network . val , item . codeExample . bisq ) " target = "_blank" > {{ item.httpRequestMethod }} {{ baseNetworkUrl }}/api{{ item.urlString }}< / a >
2022-02-07 13:25:36 -05:00
< / ng-container >
2022-03-12 15:21:50 -05:00
< ng-template # liquid_link_example >
< ng-container * ngIf = "item.httpRequestMethod === 'GET' && network.val === 'liquid' && item.codeExample.hasOwnProperty('liquid');else default_link_example" >
< a [ href ] = " wrapUrl ( network . val , item . codeExample . liquid ) " target = "_blank" > {{ item.httpRequestMethod }} {{ baseNetworkUrl }}/api{{ item.urlString }}< / a >
< / ng-container >
< / ng-template >
< ng-template # default_link_example >
< ng-container * ngIf = "item.httpRequestMethod === 'GET'" >
< a [ href ] = " wrapUrl ( network . val , item . codeExample . default ) " target = "_blank" > {{ item.httpRequestMethod }} {{ baseNetworkUrl }}/api{{ item.urlString }}< / a >
< / ng-container >
< / ng-template >
< div * ngIf = "item.httpRequestMethod === 'POST'" > {{ item.httpRequestMethod }} {{ item.urlString }}< / div >
< / div >
< div class = "description" >
< div class = "subtitle" i18n > Description< / div >
< ng-container * ngIf = "network.val === 'bisq' && item.description.hasOwnProperty('bisq');else liquid_description" # bisq_description >
< div [ innerHTML ] = " item . description . bisq " i18n > < / div >
2022-02-07 13:25:36 -05:00
< / ng-container >
2022-03-12 15:21:50 -05:00
< ng-template # liquid_description >
< ng-container * ngIf = "network.val === 'liquid' && item.description.hasOwnProperty('liquid');else default_description" >
< div [ innerHTML ] = " item . description . liquid " i18n > < / div >
< / ng-container >
< / ng-template >
< ng-template # default_description >
< div [ innerHTML ] = " item . description . default " i18n > < / div >
< / ng-template >
< / div >
< ng-container * ngIf = "network.val === 'bisq' && item.codeExample.hasOwnProperty('bisq');else liquid_code_example" # bisq_code_example >
< app-code-template [ hostname ] = " hostname " [ baseNetworkUrl ] = " baseNetworkUrl " [ method ] = " item . httpRequestMethod " [ code ] = " item . codeExample . bisq " [ network ] = " network . val " > < / app-code-template >
2022-02-07 13:25:36 -05:00
< / ng-container >
2022-03-12 15:21:50 -05:00
< ng-template # liquid_code_example >
< ng-container * ngIf = "network.val === 'liquid' && item.codeExample.hasOwnProperty('liquid');else default_code_example" >
< app-code-template [ hostname ] = " hostname " [ baseNetworkUrl ] = " baseNetworkUrl " [ method ] = " item . httpRequestMethod " [ code ] = " item . codeExample . liquid " [ network ] = " network . val " > < / app-code-template >
2022-02-07 13:25:36 -05:00
< / ng-container >
< / ng-template >
2022-03-12 15:21:50 -05:00
< ng-template # default_code_example >
< app-code-template [ hostname ] = " hostname " [ baseNetworkUrl ] = " baseNetworkUrl " [ method ] = " item . httpRequestMethod " [ code ] = " item . codeExample . default " [ network ] = " network . val " > < / app-code-template >
2022-02-07 13:25:36 -05:00
< / ng-template >
< / div >
2021-12-16 08:46:51 -05:00
< / div >
2021-12-15 13:17:37 -05:00
< / div >
2021-12-01 17:01:50 -05:00
< / div >
< / div >
< div id = "websocketAPI" * ngIf = "!restTabActivated && ( network.val !== 'bisq' )" >
< div class = "api-category" >
< div class = "websocket" >
< div class = "endpoint" >
< div class = "subtitle" i18n = "Api docs endpoint" > Endpoint< / div >
2022-02-07 13:25:36 -05:00
{{ wrapUrl(network.val, wsDocs, true) }}
2021-12-01 17:01:50 -05:00
< / div >
< div class = "description" >
< div class = "subtitle" i18n > Description< / div >
< div i18n = "api-docs.websocket.websocket" > Default push: < code > {{ '{' }} action: 'want', data: ['blocks', ...] {{ '}' }}< / code > to express what you want pushed. Available: < code > blocks< / code > , < code > mempool-blocks< / code > , < code > live-2h-chart< / code > , and < code > stats< / code > .< br > < br > Push transactions related to address: < code > {{ '{' }} 'track-address': '3PbJ...bF9B' {{ '}' }}< / code > to receive all new transactions containing that address as input or output. Returns an array of transactions. < code > address-transactions< / code > for new mempool transactions, and < code > block-transactions< / code > for new block confirmed transactions.< / div >
< / div >
2022-02-07 13:25:36 -05:00
< app-code-template [ method ] = " ' websocket ' " [ hostname ] = " hostname " [ code ] = " wsDocs " [ network ] = " network . val " > < / app-code-template >
2021-12-01 17:01:50 -05:00
< / div >
< / div >
< / div >
< / div >
< / ng-container >
2022-02-07 13:25:36 -05:00