Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b2a246f
feat: add wallet address initial snippets
BlairCurrey Dec 4, 2025
be4cddd
chore: formatting
BlairCurrey Dec 4, 2025
070a91a
feat: add token, wa info go sdk examples
BlairCurrey Dec 14, 2025
2a4835a
feat: add more sdk examples, go back and make previous consistent
BlairCurrey Dec 14, 2025
c0f4414
feat: add grant sdk examples
BlairCurrey Dec 14, 2025
514ce00
feat: add incoming payment examples
BlairCurrey Dec 14, 2025
65366ea
feat: add op go sdk examples
BlairCurrey Dec 14, 2025
cf637a5
feat: add quote examples to go sdk
BlairCurrey Dec 14, 2025
466470a
feat: fight prettier, add guide
BlairCurrey Dec 14, 2025
e1be9cf
feat: fight prettier, add guide
BlairCurrey Dec 14, 2025
d61d69c
feat: fight prettier, add guide
BlairCurrey Dec 15, 2025
b5e06a9
feat: fight prettier, add guide
BlairCurrey Dec 15, 2025
57ee230
feat: fight prettier, add guide
BlairCurrey Dec 15, 2025
7e22e43
feat: add guide
BlairCurrey Dec 15, 2025
1a3af11
feat: add guide
BlairCurrey Dec 15, 2025
35f7446
feat: add guide, fix missing interact ref in previous
BlairCurrey Dec 15, 2025
fef2763
Merge branch 'main' into blair/gol-16
BlairCurrey Dec 16, 2025
ee04ceb
chore: fight prettier, format
BlairCurrey Dec 16, 2025
2e465af
chore: rm go stuff from chunked snippet
BlairCurrey Dec 16, 2025
a8e6c4f
chore: rm prettier ignore
BlairCurrey Dec 16, 2025
915c72a
chore: fix extra backticks
BlairCurrey Dec 16, 2025
c581fe3
fix: formatting
BlairCurrey Dec 16, 2025
de15589
Update docs/src/content/docs/sdk/incoming-create.mdx
BlairCurrey Jan 5, 2026
0a9a684
Update docs/src/content/docs/sdk/incoming-create.mdx
BlairCurrey Jan 5, 2026
af4ed0c
chore: format
BlairCurrey Jan 5, 2026
8638ec3
docs: add es guide
BlairCurrey Jan 7, 2026
f889a1c
docs: add es guide
BlairCurrey Jan 7, 2026
cdc4a5f
docs: add es guide, fix en format
BlairCurrey Jan 7, 2026
0cb5634
docs: add es guide
BlairCurrey Jan 7, 2026
d6b0cd2
docs: add es guide
BlairCurrey Jan 7, 2026
2812c4a
docs: add es guide
BlairCurrey Jan 7, 2026
d78b91c
docs: add es guide
BlairCurrey Jan 7, 2026
ed89da3
docs: add es guide
BlairCurrey Jan 7, 2026
c4da92f
chore: pr feedback (formatting, revert submodule update)
BlairCurrey Jan 7, 2026
0aa6f8c
Update docs/src/content/docs/guides/split-payments.mdx
BlairCurrey Jan 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/src/components/ChunkedSnippet.astro
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ const languageConfig: Record<string, LanguageConfig> = {
parser: '',
lang: 'rs',
plugins: []
},
'.go': {
parser: '',
lang: 'go',
plugins: []
}
}

Expand Down Expand Up @@ -151,7 +156,7 @@ const formatByLanguage = async (
})
return formatted.replace(/^<\?php\s*/, '')
}
if (lang === 'rs') {
if (lang === 'rs' || lang === 'go') {
return dedentBlock(text)
}
if (parser) {
Expand Down
31 changes: 30 additions & 1 deletion docs/src/content/docs/sdk/wallet-get-info.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,37 @@ For JavaScript, run `node path/to/directory/index.js`. <LinkOut href='https://gi

<p><LinkOut href='https://github.com/interledger/open-payments-php-snippets/blob/main/src/Command/WalletAddress/PublicGetWalletAddress.php'>View full source</LinkOut></p>
</TabItem>
</Tabs>

<TabItem label="Go" icon='seti:go'>
<LinkButton href="https://github.com/interledger/open-payments-go/blob/main/README.md" target="_blank" icon="external" iconPlacement="start">Prerequisites</LinkButton>

<ChunkedSnippet
source="wallet-address/wallet-address-get.go"
l="go"
chunk="1"
/>

<ChunkedSnippet
source="wallet-address/wallet-address-get.go"
l="go"
chunk="2"
/>

<ChunkedSnippet
source="wallet-address/wallet-address-get.go"
l="go"
chunk="3"
/>

<ChunkedSnippet
source="wallet-address/wallet-address-get.go"
l="go"
chunk="4"
/>

<p><LinkOut href='https://github.com/interledger/open-payments/blob/main/snippets/go/wallet-address/wallet-address-get.go'>View full Go source</LinkOut></p>
</TabItem>
</Tabs>
## References

- [API specification](/apis/wallet-address-server/operations/get-wallet-address)
Expand Down
30 changes: 30 additions & 0 deletions docs/src/content/docs/sdk/wallet-get-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,36 @@ For JavaScript, run `node path/to/directory/index.js`. <LinkOut href='https://gi

<p><LinkOut href='https://github.com/interledger/open-payments-php-snippets/blob/main/src/Command/WalletAddress/PublicGetWalletAddressKeys.php'>View full source</LinkOut></p>
</TabItem>

<TabItem label="Go" icon='seti:go'>
<LinkButton href="https://github.com/interledger/open-payments-go/blob/main/README.md" target="_blank" icon="external" iconPlacement="start">Prerequisites</LinkButton>

<ChunkedSnippet
source="wallet-address/wallet-address-get-keys.go"
l="go"
chunk="1"
/>

<ChunkedSnippet
source="wallet-address/wallet-address-get-keys.go"
l="go"
chunk="2"
/>

<ChunkedSnippet
source="wallet-address/wallet-address-get-keys.go"
l="go"
chunk="3"
/>

<ChunkedSnippet
source="wallet-address/wallet-address-get-keys.go"
l="go"
chunk="4"
/>

<p><LinkOut href='https://github.com/interledger/open-payments/blob/main/snippets/go/wallet-address/wallet-address-get-keys.go'>View full Go source</LinkOut></p>
</TabItem>
</Tabs>

## References
Expand Down
2 changes: 1 addition & 1 deletion open-payments-specifications
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not update the spec version yet (since we don't want to show grant spent amounts API being available before have the docs for the grant spent amount feature).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont remember exactly what commit we were on before, and I didn't figure out a clean way to revert, so I changed it to the previous commit (41ea94b (tag: v1.1.1) fix: resource server signature spec (#21)) which I think should be fine (and possibly what it was before).

54 changes: 54 additions & 0 deletions snippets/go/wallet-address/wallet-address-get-keys.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package main

//@! start chunk 1 | title=Import dependencies
import (
"context"
"encoding/json"
"fmt"
"log"
"os"

op "github.com/interledger/open-payments-go"
)

//@! end chunk 1

func main() {
walletAddressURL := os.Getenv("WALLET_ADDRESS")
if walletAddressURL == "" {
log.Fatalf("WALLET_ADDRESS environment variable is required\n")
}
privateKeyBase64 := os.Getenv("PRIVATE_KEY")
if privateKeyBase64 == "" {
log.Fatalf("PRIVATE_KEY environment variable is required\n")
}
keyID := os.Getenv("KEY_ID")
if keyID == "" {
log.Fatalf("KEY_ID environment variable is required\n")
}

//@! start chunk 2 | title=Initialize Open Payments client
client, err := op.NewAuthenticatedClient(walletAddressURL, privateKeyBase64, keyID)
if err != nil {
log.Fatalf("Error creating authenticated client: %v\n", err)
}
//@! end chunk 2

//@! start chunk 3 | title=Get wallet address keys
walletAddressKeys, err := client.WalletAddress.GetKeys(context.TODO(), op.WalletAddressGetKeysParams{
URL: walletAddressURL,
})
if err != nil {
log.Fatalf("Error fetching wallet address keys: %v\n", err)
}
//@! end chunk 3

//@! start chunk 4 | title=Output
keysJSON, err := json.MarshalIndent(walletAddressKeys, "", " ")
if err != nil {
log.Fatalf("Error marshaling wallet address keys: %v\n", err)
}
fmt.Println("WALLET ADDRESS KEYS:", string(keysJSON))
//@! end chunk 4
}

54 changes: 54 additions & 0 deletions snippets/go/wallet-address/wallet-address-get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package main

//@! start chunk 1 | title=Import dependencies
import (
"context"
"encoding/json"
"fmt"
"log"
"os"

op "github.com/interledger/open-payments-go"
)

//@! end chunk 1

func main() {
walletAddressURL := os.Getenv("WALLET_ADDRESS")
if walletAddressURL == "" {
log.Fatalf("WALLET_ADDRESS environment variable is required\n")
}
privateKeyBase64 := os.Getenv("PRIVATE_KEY")
if privateKeyBase64 == "" {
log.Fatalf("PRIVATE_KEY environment variable is required\n")
}
keyID := os.Getenv("KEY_ID")
if keyID == "" {
log.Fatalf("KEY_ID environment variable is required\n")
}

//@! start chunk 2 | title=Initialize Open Payments client
client, err := op.NewAuthenticatedClient(walletAddressURL, privateKeyBase64, keyID)
if err != nil {
log.Fatalf("Error creating authenticated client: %v\n", err)
}
//@! end chunk 2

//@! start chunk 3 | title=Get wallet address
walletAddress, err := client.WalletAddress.Get(context.TODO(), op.WalletAddressGetParams{
URL: walletAddressURL,
})
if err != nil {
log.Fatalf("Error fetching wallet address: %v\n", err)
}
//@! end chunk 3

//@! start chunk 4 | title=Output
walletAddressJSON, err := json.MarshalIndent(walletAddress, "", " ")
if err != nil {
log.Fatalf("Error marshaling wallet address: %v\n", err)
}
fmt.Println("WALLET ADDRESS:", string(walletAddressJSON))
//@! end chunk 4
}