Skip to content

Commit 96051e0

Browse files
authored
Merge pull request #14 from interledger/release-0.1.2
fix: update doc comments to reflect correct flows
2 parents 2a6d4b7 + f3c8f1e commit 96051e0

File tree

7 files changed

+30
-14
lines changed

7 files changed

+30
-14
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "open-payments"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
edition = "2021"
55
authors = ["Interledger <[email protected]>"]
66
description = "Open Payments Rust SDK library with types, HTTP client and signature utilities"
@@ -9,7 +9,6 @@ repository = "https://github.com/interledger/open-payments-rust"
99
readme = "README.md"
1010
keywords = ["open-payments", "interledger", "payments", "http-signatures", "gnap"]
1111
categories = ["api-bindings", "web-programming", "asynchronous"]
12-
documentation = "https://docs.rs/open-payments"
1312
homepage = "https://github.com/interledger/open-payments-rust"
1413

1514
[features]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Open Payments Rust
1+
# Open Payments
22

33
<p align="center">
44
<img src="https://raw.githubusercontent.com/interledger/open-payments/main/docs/public/img/logo.svg" width="700" alt="Open Payments">

src/client/mod.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
//!
2929
//! ```rust,no_run
3030
//! use open_payments::client::{AuthenticatedClient, ClientConfig, AuthenticatedResources, UnauthenticatedResources};
31+
//! use open_payments::types::{GrantRequest, AccessTokenRequest, AccessItem, IncomingPaymentAction, CreateIncomingPaymentRequest};
3132
//!
3233
//! #[tokio::main]
3334
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
@@ -45,10 +46,24 @@
4546
//! // Example of how to use the client (would require actual server)
4647
//! let wallet_address = client.wallet_address().get("https://rafiki.money/alice").await?;
4748
//!
49+
//! // Example of how to request a grant
50+
//! let grant_request = GrantRequest {
51+
//! access_token: AccessTokenRequest {
52+
//! access: vec![AccessItem::IncomingPayment {
53+
//! actions: vec![IncomingPaymentAction::Create, IncomingPaymentAction::Read],
54+
//! identifier: None,
55+
//! }],
56+
//! },
57+
//! client: "https://rafiki.money/alice".to_string(),
58+
//! interact: None,
59+
//! };
60+
//!
61+
//! let access_token = client.grant().request(&wallet_address.auth_server, &grant_request).await?;
62+
//!
4863
//! // Example of creating a payment request
4964
//! let resource_server = "https://ilp.rafiki.money";
5065
//! let access_token = "your-access-token";
51-
//! let payment_request = open_payments::types::resource::CreateIncomingPaymentRequest {
66+
//! let payment_request = CreateIncomingPaymentRequest {
5267
//! wallet_address: wallet_address.id,
5368
//! incoming_amount: None,
5469
//! expires_at: None,

src/client/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ impl AuthenticatedRequest<'_> {
229229
///
230230
/// This method generates `Content-Length` and `Content-Digest` headers for
231231
/// requests with body content. The content digest uses SHA-512 hashing
232-
/// as required by the Open Payments protocol.
232+
/// as required by the Open Payments specification.
233233
///
234234
/// ## Arguments
235235
///

src/http_signature/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! This module provides utilities for creating and validating HTTP message signatures
44
//! according to the [HTTP Message Signatures](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-message-signatures) specification.
5-
//! It supports Ed25519 signing and is designed for use with the Open Payments protocol.
5+
//! It supports Ed25519 signing and is designed for use with the Open Payments specification.
66
//!
77
//! ## Features
88
//!

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! # Open Payments Rust Client
22
//!
3-
//! A Rust client library for the Open Payments protocol, providing types and HTTP signatures utilities for building Open Payments applications.
3+
//! A Rust client library for the Open Payments specification, providing types and HTTP signatures utilities for building Open Payments applications.
44
//!
55
//! ## Features
66
//!

src/types/mod.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! # Open Payments Types
22
//!
3-
//! This module contains all the type definitions for the Open Payments protocol.
3+
//! This module contains all the type definitions for the Open Payments specifications.
44
//! These types represent the data structures used in API requests and responses,
55
//! as well as the core concepts of the Open Payments ecosystem.
66
//!
@@ -23,22 +23,24 @@
2323
//! ### Common Types
2424
//!
2525
//! - [`Amount`] - Amounts of a specific currency and scale
26-
//! - [`PageInfo`] - Pagination information
27-
//! - [`PaginatedResponse`] - Generic paginated response wrapper
26+
//! - [`Receiver`] - Receiver of a payment e.g. incoming payment
27+
//! - [`WalletAddressUri`] - Wallet address descriptor
28+
//! - [`Interval`] - ISO 8601 defined interval
2829
//!
2930
//! ## Example Usage
3031
//!
3132
//! ```rust
3233
//! use open_payments::types::{
3334
//! Amount, GrantRequest, AccessTokenRequest, AccessItem, QuoteAction,
34-
//! CreateIncomingPaymentRequest, WalletAddress
35+
//! CreateIncomingPaymentRequest, WalletAddress, IncomingPaymentAction
3536
//! };
3637
//!
37-
//! // Create a grant request for quote access
38+
//! // Create a grant request for incoming payment
3839
//! let grant_request = GrantRequest {
3940
//! access_token: AccessTokenRequest {
40-
//! access: vec![AccessItem::Quote {
41-
//! actions: vec![QuoteAction::Create, QuoteAction::Read],
41+
//! access: vec![AccessItem::IncomingPayment {
42+
//! actions: vec![IncomingPaymentAction::Create, IncomingPaymentAction::Read],
43+
//! identifier: None,
4244
//! }],
4345
//! },
4446
//! client: "https://rafiki.money/alice".to_string(),

0 commit comments

Comments
 (0)