diff --git a/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx index b4448a91..06858ca9 100644 --- a/docs/src/content/docs/index.mdx +++ b/docs/src/content/docs/index.mdx @@ -6,14 +6,19 @@ hero: tagline: Open Payments is an API standard that can be implemented by any digital wallet provider. actions: - text: Read OpenPayment docs - link: /introduction/overview + link: https://docs.openpayments.guide/ icon: open-book variant: primary + - text: View on GitHub + icon: external + link: https://github.com/interledger/open-payments --- import { Card, CardGrid } from '@astrojs/starlight/components' - +{/* prettier-ignore */} +{/* + Consult the OpenAPI specifications @@ -29,4 +34,4 @@ import { Card, CardGrid } from '@astrojs/starlight/components' Join the community - + */} diff --git a/docs/src/content/docs/introduction/overview.mdx b/docs/src/content/docs/introduction/overview.mdx deleted file mode 100644 index 8f36c2fb..00000000 --- a/docs/src/content/docs/introduction/overview.mdx +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Overview -description: A guide in my new Starlight docs site. ---- - -Open Payments is an HTTP-based API that can be implemented by any digital wallet to enable clients to interface with the wallet. It uses a profile of the Grant Negotiation and Agreement Protocol to define a mechanism by which clients get authorization to use the APIs and get data about the wallet owner. diff --git a/docs/src/content/docs/introduction/payment-pointers.mdx b/docs/src/content/docs/introduction/payment-pointers.mdx deleted file mode 100644 index 26fa9b4d..00000000 --- a/docs/src/content/docs/introduction/payment-pointers.mdx +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Payment Pointers -description: Every wallet is identified by a URL that is also the API service endpoint ---- - -At the heart of all interactions in Open Payments is a digital wallet. Access to this wallet via the Open Payments APIs always starts with a URL which we call a Payment Pointer. diff --git a/docs/src/content/docs/introduction/template.mdx b/docs/src/content/docs/introduction/template.mdx deleted file mode 100644 index 50a3ded0..00000000 --- a/docs/src/content/docs/introduction/template.mdx +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: Template - Melissa (Make a one-time payment using Node.js) -description: A thing Melissa is working on ---- - -import { Disclosure } from '@interledger/docs-design-system' - -Overview text goes here - -Inspiration: https://developer.vonage.com/en/voice/voice-api/code-snippets/making-calls/make-an-outbound-call?source=voice&lang=javascript - -## Prerequisites - - - -This package provides the following TypeScript and Node.js tools for using Open Payments. - -- Exported TypeScript types generated directly from the Open Payments OpenAPI specifications -- A Node.js client that exposes Open Payment APIs and: - - Signs requests with provided key - - Validates responses against OpenAPI specs - -``` -npm install @interledger/open-payments -``` - - - - -:::caution -This is included as an example for the template. Only the authenticated client is applicable when making an OTP. -::: - -An unauthenticated client can make requests to access publicly available resources without needing to authenticate. The two available methods are (get) a wallet address and (get) keys bound to a wallet address. - -```js -import { createUnauthenticatedClient } from '@interledger/open-payments' - -const client = await createUnauthenticatedClient({ - requestTimeoutMs: 1000, // optional, defaults to 5000 - logger: customLoggerInstance // optional, defaults to pino logger -}) - -const walletAddress = await client.walletAddress.get({ - url: '' -}) -``` - - - - -An authenticated client provides the same methods as the unauthenticated client, as well as the remaining Open Payment API methods for both the authorization and resource specs. Each request requiring authentication will be signed using [HTTP Message Signatures](https://github.com/interledger/open-payments/tree/main/packages/http-signature-utils) with the given private key. Installing the Open Payments page also installs the Open Payments HTTP Signature Utils Library. - -``` -import { createAuthenticatedClient } from '@interledger/open-payments' - -const client = await createAuthenticatedClient({ - keyId: KEY_ID, - privateKey: PRIVATE_KEY, - walletAddressUrl: WALLET_ADDRESS_URL -}) -``` - -Provide the following properties to create the client. - -| Property | Description | -| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| keyId | The key identifier of the given private key and the corresponding public JWK document. | -| privateKey | The private EdDSA-Ed25519 key that’s bound to the wallet address and used by the client to sign authenticated requests A public JWK document created from and signed with the privateKey must be available at the `{walletAddressUrl}/jwks.json` URL. You can use methods from the  [@interledger/http-signature-utils](https://github.com/interledger/open-payments/tree/main/packages/http-signature-utils) package to simplify EdDSA-Ed25519 key provisioning and JWK generation. | -| walletAddressUrl | The valid wallet address with which the client making requests will identify itself. The wallet address will be used as the value of the `client` parameter when [making a new grant request](https://docs.openpayments.guide/reference/post-request). A JWKS document that includes the public key that the client instance will use to protect requests must be available at the `{walletAddressUrl}/jwks.json` URL. | - - - -## Write the code - -Add the following to `filename.js`. - -Replace the following variables in the Write the Code snippet. - -| Thing 1 | Thing 2 | -| ------- | ------- | -| Stuff 1 | Stuff 2 | - -``` -Code -``` - -[View full source](http://google.com) - -## Run the code - -Save this file to your machine and run it. - -``` -Code -``` - -## Try it out - -E.g., When you run the code the TO_NUMBER will be called and a text-to-speech message will be heard if the call is answered. - -## Further reading - -- [First thing](http://google.com) - Description diff --git a/docs/src/content/docs/security/gnap.mdx b/docs/src/content/docs/security/gnap.mdx deleted file mode 100644 index 5a2803a7..00000000 --- a/docs/src/content/docs/security/gnap.mdx +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: GNAP -description: The Grant Negotiation and Authorization Protocol ---- - -Open Payments leverages the [Grant Negotiation and Authorization Protocol (GNAP)](https://datatracker.ietf.org/doc/html/draft-ietf-gnap-core-protocol) to define a standard mechanism for requesting and granting access tokens for the APIs.