-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement grpc_gateway api client
- Loading branch information
1 parent
21fe52c
commit 8948a20
Showing
31 changed files
with
1,857 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: nanasess/setup-chromedriver@master | ||
- run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | ||
- run: wasm-pack test --headless --chrome | ||
working-directory: xmtp_api_grpc_gateway |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
use wasm_bindgen::prelude::*; | ||
use wasm_bindgen::prelude::{wasm_bindgen, JsError}; | ||
use xmtp_api_grpc_gateway::XmtpGrpcGatewayClient; | ||
|
||
#[wasm_bindgen] | ||
pub struct WasmXmtpClient { | ||
// TODO | ||
api: XmtpGrpcGatewayClient, | ||
// inbox_owner: WasmInboxOwner, | ||
} | ||
|
||
impl WasmXmtpClient { | ||
pub fn api(&self) -> &XmtpGrpcGatewayClient { | ||
&self.api | ||
} | ||
} | ||
|
||
#[wasm_bindgen] | ||
impl WasmXmtpClient { | ||
#[wasm_bindgen(constructor)] | ||
pub fn new() -> Result<WasmXmtpClient, JsError> { | ||
pub fn new(url: String) -> Result<WasmXmtpClient, JsError> { | ||
// TODO | ||
Ok(WasmXmtpClient {}) | ||
Ok(WasmXmtpClient { | ||
api: XmtpGrpcGatewayClient::new(url), | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.