-
Notifications
You must be signed in to change notification settings - Fork 5
Add SDKs & CLI documentation page #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,15 @@ | ||
| --- | ||
| title: 'SDKs & CLI' | ||
| icon: "/images/icons/code.svg" | ||
| description: 'Official client libraries and command-line interface for the Grid API' | ||
| "og:image": "/images/og/og-api-reference-generic.png" | ||
| --- | ||
|
|
||
| import Sdks from '/snippets/sdks.mdx'; | ||
| import Cli from '/snippets/cli.mdx'; | ||
|
|
||
| <Sdks /> | ||
|
|
||
| ## CLI | ||
|
|
||
| <Cli /> |
This file contains hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,118 @@ | ||
| The Grid CLI lets you interact with the Grid API directly from your terminal — manage customers, send payments, create quotes, and test in sandbox without writing any code. | ||
|
|
||
| <Card | ||
| title="Grid CLI" | ||
| icon="square-terminal" | ||
| href="https://github.com/lightsparkdev/grid-api/tree/main/cli" | ||
| > | ||
| Open-source CLI built with Node.js and TypeScript. | ||
| </Card> | ||
|
|
||
| ### Installation | ||
|
|
||
| **Prerequisites:** Node.js v20 or v22 is required. | ||
|
|
||
| ```bash | ||
| git clone https://github.com/lightsparkdev/grid-api.git | ||
| cd grid-api/cli | ||
| npm install | ||
| npm run build | ||
| npm link # makes `grid` available globally | ||
| ``` | ||
|
|
||
| ### Configuration | ||
|
|
||
| Configure your credentials interactively: | ||
|
|
||
| ```bash | ||
| grid configure | ||
| ``` | ||
|
|
||
| This prompts for your API Token ID and Client Secret, validates them, and saves to `~/.grid-credentials`. | ||
|
|
||
| Alternatively, set environment variables: | ||
|
|
||
| ```bash | ||
| export GRID_API_TOKEN_ID="your-token-id" | ||
| export GRID_API_CLIENT_SECRET="your-client-secret" | ||
| ``` | ||
|
|
||
| ### Commands | ||
|
|
||
| | Command | Description | | ||
| |---------|-------------| | ||
| | `grid configure` | Set up API credentials | | ||
| | `grid config get` | View platform configuration | | ||
| | `grid customers list` | List customers | | ||
| | `grid customers create` | Create a customer | | ||
| | `grid accounts internal list` | List internal accounts | | ||
| | `grid accounts external create` | Create an external bank account or wallet | | ||
| | `grid quotes create` | Create a payment quote | | ||
| | `grid quotes execute` | Execute a pending quote | | ||
| | `grid transfers in` | Transfer funds in (external to internal) | | ||
| | `grid transfers out` | Transfer funds out (internal to external) | | ||
| | `grid transactions list` | List transactions | | ||
| | `grid transactions get` | Get transaction details | | ||
| | `grid receiver lookup-uma` | Look up a UMA address | | ||
| | `grid sandbox fund` | Fund a sandbox account | | ||
| | `grid sandbox send` | Simulate sending funds to a JIT quote | | ||
| | `grid sandbox receive` | Simulate receiving a UMA payment | | ||
|
|
||
| Short aliases are available: `cust` for `customers`, `tx` for `transactions`, `acct` for `accounts`. | ||
|
|
||
| ### Example: Send USDC to a Mexico Bank Account | ||
|
|
||
| <Steps> | ||
| <Step title="Create a customer"> | ||
| ```bash | ||
| grid customers create \ | ||
| --platform-id "your-id" \ | ||
| --type INDIVIDUAL \ | ||
| --full-name "Carlos Garcia" \ | ||
| --birth-date "1988-03-20" \ | ||
| --address-line1 "Av Reforma 222" \ | ||
| --address-city "Mexico City" \ | ||
| --address-state "CDMX" \ | ||
| --address-postal "06600" \ | ||
| --address-country "MX" | ||
| ``` | ||
| </Step> | ||
| <Step title="Create an external CLABE account for the customer"> | ||
| ```bash | ||
| grid accounts external create \ | ||
| --customer-id <customerId> \ | ||
| --currency MXN \ | ||
| --account-type CLABE \ | ||
| --clabe "012345678901234567" \ | ||
| --beneficiary-type INDIVIDUAL \ | ||
| --beneficiary-name "Carlos Garcia" \ | ||
| --beneficiary-birth-date "1988-03-20" \ | ||
| --beneficiary-nationality MX | ||
| ``` | ||
| </Step> | ||
| <Step title="Create a quote"> | ||
| ```bash | ||
| grid quotes create \ | ||
| --source-customer <customerId> \ | ||
| --source-currency USDC \ | ||
| --dest-account <externalAccountId> \ | ||
| --dest-currency MXN \ | ||
| --amount 100000 \ | ||
| --lock-side RECEIVING | ||
| ``` | ||
| </Step> | ||
| <Step title="In sandbox, simulate the USDC deposit"> | ||
| ```bash | ||
| grid sandbox send --quote-id <quoteId> --currency USDC | ||
| ``` | ||
| </Step> | ||
| <Step title="Check transaction status"> | ||
| ```bash | ||
| grid transactions get <transactionId> | ||
| ``` | ||
| </Step> | ||
| </Steps> | ||
|
|
||
| <Note> | ||
| All amounts are in the **smallest currency unit** (e.g., cents for USD, satoshis for BTC). Quotes expire in 1–5 minutes. | ||
| </Note> | ||
|
greptile-apps[bot] marked this conversation as resolved.
|
||
This file contains hidden or 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,18 @@ | ||
| Grid provides official SDKs to help you integrate faster. These libraries wrap the Grid API with idiomatic interfaces, type safety, and built-in error handling. | ||
|
|
||
| <CardGroup cols={2}> | ||
| <Card | ||
| title="JavaScript / TypeScript" | ||
| icon="js" | ||
| href="https://github.com/lightsparkdev/grid-js-sdk" | ||
| > | ||
| Install via npm and start building with full TypeScript support. | ||
| </Card> | ||
| <Card | ||
| title="Kotlin" | ||
| icon="/images/icons/kotlin.svg" | ||
| href="https://github.com/lightsparkdev/grid-kotlin-sdk" | ||
| > | ||
| For JVM and Android applications. Available on Maven Central. | ||
| </Card> | ||
| </CardGroup> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.