Compare commits

..

263 Commits

Author SHA1 Message Date
mDuo13
3a548852ae rm reference to pre-refactor escrow code sample 2025-10-13 14:23:07 -07:00
mDuo13
892f9202c5 Finish updating timed escrow tutorial 2025-10-10 16:38:04 -07:00
mDuo13
8c25a5ea33 Start implementing tutorial for updated timed escrow sample 2025-09-17 18:19:53 -07:00
mDuo13
242a6cc31b Show two possible formats of Escrow sample code 2025-09-17 16:39:30 -07:00
Aria Keshmiri
a293e0fd1f Merge pull request #3305 from XRPLF/community-copy-updates
Update community page content and links
2025-09-17 14:34:43 -07:00
akcodez
f807765dea update title 2025-09-17 14:06:26 -07:00
akcodez
fc8ccac32b update copy 2025-09-17 12:29:34 -07:00
akcodez
701363646d update copy 2025-09-17 10:35:04 -07:00
Rome Reginelli
bf9ffc11a3 Merge pull request #3303 from XRPLF/dependabot/npm_and_yarn/axios-1.12.1
Bump axios from 1.11.0 to 1.12.1
2025-09-16 14:32:16 -07:00
akcodez
6b10cf3568 Update community page content and links 2025-09-16 13:50:38 -07:00
dependabot[bot]
3338edbf04 Bump axios from 1.11.0 to 1.12.1
Bumps [axios](https://github.com/axios/axios) from 1.11.0 to 1.12.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.11.0...v1.12.1)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.12.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-13 16:11:47 +00:00
Rome Reginelli
7cb5f9a893 Merge pull request #3277 from XRPLF/fix_curl_modal
WS Tool fixes: cURL modal, Clio Only
2025-09-11 13:26:31 -07:00
Maria Shodunke
185f81c043 Merge pull request #3297 from XRPLF/dependabot/go_modules/_code-samples/send-a-memo/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/send-a-memo/go
2025-09-11 17:55:05 +01:00
dependabot[bot]
207cd2e4d3 Bump golang.org/x/crypto in /_code-samples/send-a-memo/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-11 12:48:21 +00:00
Maria Shodunke
a6e6b2207f Merge pull request #3296 from XRPLF/dependabot/go_modules/_code-samples/paths/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/paths/go
2025-09-11 13:44:05 +01:00
dependabot[bot]
03c7d1c733 Bump golang.org/x/crypto in /_code-samples/paths/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-11 12:31:53 +00:00
Maria Shodunke
4150559991 Merge pull request #3295 from XRPLF/dependabot/go_modules/_code-samples/set-regular-key/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/set-regular-key/go
2025-09-11 13:30:40 +01:00
dependabot[bot]
ceff82cefd Bump golang.org/x/crypto in /_code-samples/set-regular-key/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-11 12:24:17 +00:00
Maria Shodunke
052f388124 Merge pull request #3294 from XRPLF/dependabot/go_modules/_code-samples/batch/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/batch/go
2025-09-11 13:22:56 +01:00
dependabot[bot]
6e73b80015 Bump golang.org/x/crypto in /_code-samples/batch/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-11 10:51:19 +00:00
Maria Shodunke
bcd4eb1815 Merge pull request #3293 from XRPLF/dependabot/go_modules/_code-samples/checks/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/checks/go
2025-09-11 11:50:26 +01:00
dependabot[bot]
57cac13e37 Bump golang.org/x/crypto in /_code-samples/checks/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-11 10:42:45 +00:00
Maria Shodunke
aeb129f709 Merge pull request #3292 from XRPLF/dependabot/go_modules/_code-samples/clawback/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/clawback/go
2025-09-11 11:41:51 +01:00
dependabot[bot]
f93e5bfe17 Bump golang.org/x/crypto in /_code-samples/clawback/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-11 10:38:58 +00:00
Maria Shodunke
755ff162ee Merge pull request #3291 from XRPLF/dependabot/go_modules/_code-samples/credential/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/credential/go
2025-09-11 11:37:55 +01:00
dependabot[bot]
017c68e1f0 Bump golang.org/x/crypto in /_code-samples/credential/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-11 10:33:38 +00:00
Maria Shodunke
d4ed2f249e Merge pull request #3290 from XRPLF/dependabot/go_modules/_code-samples/delegate-set/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/delegate-set/go
2025-09-11 11:32:37 +01:00
dependabot[bot]
569df18b8a Bump golang.org/x/crypto in /_code-samples/delegate-set/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-11 10:23:35 +00:00
Maria Shodunke
9c425c3d95 Merge pull request #3289 from XRPLF/dependabot/go_modules/_code-samples/deposit-preauth/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/deposit-preauth/go
2025-09-11 11:22:32 +01:00
dependabot[bot]
2de6343f87 Bump golang.org/x/crypto in /_code-samples/deposit-preauth/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-11 10:12:22 +00:00
Maria Shodunke
6eb0632162 Merge pull request #3288 from XRPLF/dependabot/go_modules/_code-samples/freeze/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/freeze/go
2025-09-11 11:11:20 +01:00
dependabot[bot]
629cd05b47 Bump golang.org/x/crypto in /_code-samples/freeze/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-11 10:06:23 +00:00
Maria Shodunke
2c842fd367 Merge pull request #3287 from XRPLF/dependabot/go_modules/_code-samples/get-started/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/get-started/go
2025-09-11 11:05:18 +01:00
Aria Keshmiri
34f2503cd1 Merge pull request #3257 from XRPLF/payments-page-update 2025-09-10 11:34:22 -07:00
akcodez
6ddf7ea293 design touh ups 2025-09-10 11:00:48 -07:00
akcodez
69323213cc Merge remote-tracking branch 'origin' into payments-page-update 2025-09-10 10:16:17 -07:00
Amarantha Kulkarni
a59fd5c9bb Merge pull request #3279 from XRPLF/blog-mpt-standard-fortstock
Add blog post about how FortStock is using the MPT standard
2025-09-10 10:15:05 -07:00
dependabot[bot]
989fc91b1b Bump golang.org/x/crypto in /_code-samples/get-tx/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 10:14:36 -07:00
dependabot[bot]
d6193a3184 Bump golang.org/x/crypto in /_code-samples/issue-a-token/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 10:14:35 -07:00
dependabot[bot]
36d674deb3 Bump golang.org/x/crypto in /_code-samples/multisigning/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 10:14:35 -07:00
dependabot[bot]
8b4a92c53c Bump golang.org/x/crypto in /_code-samples/non-fungible-token/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 10:14:35 -07:00
dependabot[bot]
610a27d383 Bump golang.org/x/crypto in /_code-samples/partial-payment/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 10:14:35 -07:00
dependabot[bot]
4beca725cb Bump golang.org/x/crypto in /_code-samples/use-tickets/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 10:14:35 -07:00
dependabot[bot]
71640e2e27 Bump golang.org/x/crypto in /_code-samples/send-xrp/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 10:14:35 -07:00
dependabot[bot]
07984bdbd6 Bump golang.org/x/crypto in /_code-samples/secure-signing/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 10:14:35 -07:00
Oliver Eggert
1887ef52e2 add reviewer suggestions 2025-09-10 10:14:35 -07:00
Oliver Eggert
46626d300b add 2.5.1 release notes 2025-09-10 10:14:35 -07:00
Maria Shodunke
3391a79503 Fix wide screen gap 2025-09-10 10:14:35 -07:00
mDuo13
9ac9d976c8 Fix various style issues 2025-09-10 10:14:26 -07:00
mDuo13
de8bc3faaf Adjust style colors & improve code walkthrough 2025-09-10 10:14:18 -07:00
Maria Shodunke
00e29b4354 Remove commented out CSS + generate content.scss 2025-09-10 10:14:00 -07:00
akcodez
2e8b0565f7 merge main in 2025-09-10 10:13:44 -07:00
Maria Shodunke
ba610a3fb2 Add JS README.md 2025-09-10 10:12:07 -07:00
Maria Shodunke
73b90de313 Apply suggestions from code review
Co-authored-by: Rome Reginelli <rome@ripple.com>
2025-09-10 10:12:07 -07:00
Maria Shodunke
bd456557ae Add improvements to walkthrough 2025-09-10 10:12:06 -07:00
Maria Shodunke
9c9b0657a9 Demo for code walkthrough functionality 2025-09-10 10:12:06 -07:00
banasa44
77216d5776 fix(docs): correct terminology from "GoLang" to "Go" in tutorial files, replace code snippets to references. 2025-09-10 10:12:06 -07:00
banasa44
3855ea8065 chore(sample-docs): unify error handling with panic(err). 2025-09-10 10:12:06 -07:00
banasa44
1f3e1ee670 chore(code-samples): remove all emojis 2025-09-10 10:12:06 -07:00
Carles
b94d5343bc Apply suggestions from code review
Co-authored-by: Maria Shodunke <maria-robobug@users.noreply.github.com>
Co-authored-by: oeggert <117319296+oeggert@users.noreply.github.com>
2025-09-10 10:12:06 -07:00
banasa44
43630fbdca chore(samples): replace tab for 4 spaces 2025-09-10 10:12:06 -07:00
banasa44
2abda7d682 feat(samples): add go examples, secure signing and send a memo 2025-09-10 10:12:06 -07:00
banasa44
5288b3f5c1 chore(docs): small fixes 2025-09-10 10:12:06 -07:00
banasa44
44a3c7350e chore(docs): small fixes 2025-09-10 10:12:06 -07:00
banasa44
4b3c98ede9 chore(docs): small style and comments changes and fixes 2025-09-10 10:12:06 -07:00
banasa44
c758873f2e chore(docs): small fixes/changes in go tutorials docs 2025-09-10 10:12:06 -07:00
banasa44
f9d036d02d refactor(_code-samples): move use-tickets example 2025-09-10 10:12:06 -07:00
banasa44
ad9f42128f refactor(_code-samples): remove README.md file from code samples 2025-09-10 10:12:06 -07:00
banasa44
3ee23b8c7d feat(docs): add xrpl-go GoLang package to XRPLF documentation site 2025-09-10 10:12:06 -07:00
banasa44
ed22038bf7 feat(docs): add GoLang tutorial link and logo to the documentation index 2025-09-10 10:12:06 -07:00
banasa44
700403c6a2 refactor(_code-samples): remove Go WebSocket use-ticket example 2025-09-10 10:12:06 -07:00
banasa44
a10630dfff feat(_code-samples): WiP add go tx examples implementation and get-started section 2025-09-10 10:12:06 -07:00
banasa44
8e03dd05b6 feat(_code-samples): WiP add go tx examples implementation 2025-09-10 10:12:06 -07:00
banasa44
13e863ad51 feat(_code-samples): WiP add tx examples skeleton 2025-09-10 10:12:06 -07:00
Rome Reginelli
ca799b3fb3 Fix source link formatting
- Replace the old link with a link to the updated source version
- Add the missing "Source" title attribute so the source link will float right as intended
- Remove deprecated frontmatter
2025-09-10 10:12:06 -07:00
Oliver Eggert
263bf45bdb add em dash 2025-09-10 10:12:06 -07:00
Oliver Eggert
289c77aa9f add reviewer suggestions 2025-09-10 10:12:06 -07:00
Oliver Eggert
cbffec7a2c add warning 2025-09-10 10:12:06 -07:00
mDuo13
7b50170210 Refactor server_info/server_state response formatting slightly 2025-09-10 10:12:06 -07:00
mDuo13
eb41b9a9eb Clarify network_ledger field & remove reporting mode fields 2025-09-10 10:12:06 -07:00
Chenna Keshava B S
34f6914df2 specify information about network_ledger field in server_info response 2025-09-10 10:12:06 -07:00
tequ
201dce8fd3 address reviews 2025-09-10 10:12:05 -07:00
tequ
674af89127 [JA] Permissioned DEXes 2025-09-10 10:12:05 -07:00
tequ
77fd0e88ab address reviews 2025-09-10 10:12:05 -07:00
tequ
796bca6b2e address #2969, other fixes 2025-09-10 10:12:05 -07:00
Maria Shodunke
76c3324f4f Update enabled amendements 2025-09-10 10:12:05 -07:00
mDuo13
4da270b9d9 Remove old/inadvertent TODOs
Neither of these TODOs is relevant at the moment and they should not be
visible to readers (even in the HTML comments)
2025-09-10 10:12:05 -07:00
mDuo13
cb6dac0fa1 Migrate XLS-89d links to XLS-89 2025-09-10 10:12:05 -07:00
mDuo13
702ca01336 MPT metadata sample code: add lookup/decoding to example 2025-09-10 10:12:05 -07:00
mDuo13
7fe836921c Add sample code for XLS-89d MPT Metadata 2025-09-10 10:12:05 -07:00
Oliver Eggert
2c73708301 add reviewer suggestions 2025-09-10 10:12:05 -07:00
Oliver Eggert
ea3bbec482 add package links and sha-256 2025-09-10 10:12:05 -07:00
Oliver Eggert
cd83529517 remove mutex change 2025-09-10 10:12:05 -07:00
Oliver Eggert
d227262008 update subscribe method with network_id field in ledger and validations stream 2025-09-10 10:12:05 -07:00
Oliver Eggert
f9b49af7d6 add additional contributors 2025-09-10 10:12:05 -07:00
Oliver Eggert
96712f4b67 update contributors to github accounts 2025-09-10 10:12:05 -07:00
Oliver Eggert
514fe741e2 update known amendments 2025-09-10 10:12:05 -07:00
Oliver Eggert
6681e89d70 add release notes up to rc2 2025-09-10 10:12:05 -07:00
akcodez
a6fb937b6f update event imgae 2025-09-10 10:12:05 -07:00
akcodez
61bfad087f Update event descriptions for EasyA x Flare Harvard Hackathon and XRP Seoul Summit 2025 to enhance clarity and engagement. Adjust wording for XRP Community Night NYC to better reflect the event's purpose. 2025-09-10 10:12:05 -07:00
akcodez
c656d093a5 Add new events: EasyA x Flare Harvard Hackathon and XRP Seoul Summit 2025. Update event details for XRP Community Night NYC, including date, location, and registration link. 2025-09-10 10:12:05 -07:00
Anurag
c1b40aaea0 Update account_lines.md - fixed the request parameter table
Removed erroneously appearing `UInt32` from the request parameter table. Also fixed table formatting.
2025-09-10 10:12:05 -07:00
mDuo13
652d404914 [JA] Fix broken table syntax 2025-09-10 10:12:05 -07:00
mDuo13
f502713c7a Fix unnecessary horizontal scrolling of tables in Japanese 2025-09-10 10:12:05 -07:00
Mayukha Vadari
7d1a8b7556 Fix binary-format.md link 2025-09-10 10:12:05 -07:00
Maria Shodunke
267e73a346 Add related transactions and ledger entries (batch 3)
Fixes https://github.com/XRPLF/xrpl-dev-portal/issues/3220

- Adds related topics to the ledger entry and transaction type pages.

Preview [here](https://xrpl-dev-portal--related-topics-batch-2.preview.redocly.app/docs/references/protocol/ledger-data/ledger-entry-types/delegate)

- Batch 1: https://github.com/XRPLF/xrpl-dev-portal/pull/3235
- Batch 2: https://github.com/XRPLF/xrpl-dev-portal/pull/3246

Batch 3 covers:

- [x] MPTokenIssuance + transactions
- [x] NFTokenOffer + transactions
- [x] Offer + transactions
- [x] Oracle + transactions
- [x] PayChannel + transactions
2025-09-10 10:12:05 -07:00
dependabot[bot]
e442e4406e Bump golang.org/x/crypto in /_code-samples/get-started/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 17:08:27 +00:00
Maria Shodunke
693489336d Merge pull request #3286 from XRPLF/dependabot/go_modules/_code-samples/get-tx/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/get-tx/go
2025-09-10 18:07:30 +01:00
dependabot[bot]
8cdf5ad261 Bump golang.org/x/crypto in /_code-samples/get-tx/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 17:02:28 +00:00
Maria Shodunke
afce532e18 Merge pull request #3285 from XRPLF/dependabot/go_modules/_code-samples/issue-a-token/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/issue-a-token/go
2025-09-10 18:01:34 +01:00
dependabot[bot]
99dfd41c5e Bump golang.org/x/crypto in /_code-samples/issue-a-token/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 11:34:07 +00:00
Maria Shodunke
c409dc6ab4 Merge pull request #3284 from XRPLF/dependabot/go_modules/_code-samples/multisigning/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/multisigning/go
2025-09-10 12:33:04 +01:00
dependabot[bot]
8f2520b9c1 Bump golang.org/x/crypto in /_code-samples/multisigning/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 11:06:12 +00:00
Maria Shodunke
9ec66fd9cc Merge pull request #3283 from XRPLF/dependabot/go_modules/_code-samples/non-fungible-token/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/non-fungible-token/go
2025-09-10 12:03:43 +01:00
dependabot[bot]
459fc295f9 Bump golang.org/x/crypto in /_code-samples/non-fungible-token/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 10:55:55 +00:00
Maria Shodunke
bb7deb1d84 Merge pull request #3282 from XRPLF/dependabot/go_modules/_code-samples/partial-payment/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/partial-payment/go
2025-09-10 11:54:55 +01:00
dependabot[bot]
73dce08458 Bump golang.org/x/crypto in /_code-samples/partial-payment/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 10:50:11 +00:00
Maria Shodunke
3a9f873680 Merge pull request #3280 from XRPLF/dependabot/go_modules/_code-samples/use-tickets/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/use-tickets/go
2025-09-10 11:49:17 +01:00
dependabot[bot]
4fb8d97061 Bump golang.org/x/crypto in /_code-samples/use-tickets/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 10:43:38 +00:00
Maria Shodunke
3e73c95bba Merge pull request #3271 from XRPLF/dependabot/go_modules/_code-samples/send-xrp/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/send-xrp/go
2025-09-10 11:42:56 +01:00
Maria Shodunke
6ec132fce3 Merge pull request #3272 from XRPLF/dependabot/go_modules/_code-samples/secure-signing/go/golang.org/x/crypto-0.35.0
Bump golang.org/x/crypto from 0.23.0 to 0.35.0 in /_code-samples/secure-signing/go
2025-09-10 11:42:43 +01:00
amarantha-k
a5e170eb7c Add shorter intro paragraph and fix image filename 2025-09-09 16:28:40 -07:00
amarantha-k
db1d804d8e Add blog post for MPT 2025-09-09 16:20:32 -07:00
mDuo13
cf86789d09 Translate ClioOnly components 2025-09-09 13:53:53 -07:00
mDuo13
974d6642c9 Remove (now admin) channel_authorize method from WS tool 2025-09-09 13:43:15 -07:00
mDuo13
c68c9f975f WS Tool fixes: cURL modal, Clio Only 2025-09-09 13:35:57 -07:00
oeggert
f31fb25420 Merge pull request #3275 from XRPLF/rippled-2.5.1
Add 2.5.1 release notes
2025-09-09 09:53:57 -07:00
Oliver Eggert
908d567def add reviewer suggestions 2025-09-09 09:38:49 -07:00
Maria Shodunke
ba9eeb508d Merge pull request #3234 from XRPLF/stepped-tutorial-demo
Javascript Get Started with code walkthrough
2025-09-09 10:23:04 +01:00
Oliver Eggert
85989f35f2 add 2.5.1 release notes 2025-09-08 14:20:50 -07:00
Maria Shodunke
8ae346849a Fix wide screen gap 2025-09-08 15:36:29 +01:00
akcodez
a913fa1241 QA changes 2025-09-04 09:33:24 -07:00
dependabot[bot]
05727c628c Bump golang.org/x/crypto in /_code-samples/secure-signing/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 14:23:44 +00:00
dependabot[bot]
b0ac3d7ffe Bump golang.org/x/crypto in /_code-samples/send-xrp/go
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 14:23:43 +00:00
Maria Shodunke
ba2859ee84 Merge pull request #3211 from banasa44/docs/feat/add-go-to-docs
Add xrpl-go examples and references to xrpl-dev-portal
2025-09-04 14:28:36 +01:00
Maria Shodunke
a078c4026f Merge pull request #3270 from XRPLF/rr-free-trust-line-link
Fix source link formatting
2025-09-04 11:23:05 +01:00
mDuo13
16c2cdc399 Fix various style issues 2025-09-03 14:07:42 -07:00
Rome Reginelli
a7df284e31 Fix source link formatting
- Replace the old link with a link to the updated source version
- Add the missing "Source" title attribute so the source link will float right as intended
- Remove deprecated frontmatter
2025-09-03 14:01:19 -07:00
oeggert
a4741c56c1 Merge pull request #3269 from XRPLF/2.6.0-update
2.6.0 issue warning
2025-09-02 20:34:08 -07:00
Oliver Eggert
4571f09f40 add em dash 2025-09-02 17:07:07 -07:00
Oliver Eggert
8c0f84485c add reviewer suggestions 2025-09-02 17:02:59 -07:00
Rome Reginelli
0e3b4c34b9 Merge pull request #3252 from XRPLF/network_ledger
Update server_info and server_state methods
2025-09-02 16:14:40 -07:00
mDuo13
567aa74cc8 Adjust style colors & improve code walkthrough 2025-09-02 16:14:08 -07:00
Oliver Eggert
ec669e796f add warning 2025-09-02 16:05:24 -07:00
Rome Reginelli
d1c6c6c196 Merge pull request #3243 from tequdev/ja-permissioned-dex
[JA] Permissioned DEXes
2025-09-02 12:12:09 -07:00
Rome Reginelli
2494531419 Merge pull request #3242 from tequdev/ja-ammclawback
[JA] AMMClawback and other fixes
2025-09-02 12:09:22 -07:00
Maria Shodunke
756fa9ed22 Merge pull request #3266 from XRPLF/update-enabled-amendments-2.5.0
Update enabled amendements
2025-09-02 19:17:35 +01:00
Maria Shodunke
1892476923 Update enabled amendements 2025-09-02 19:11:13 +01:00
Maria Shodunke
cb7f7eef14 Remove commented out CSS + generate content.scss 2025-09-02 19:01:02 +01:00
mDuo13
774c418932 Improve tab & code-walkthrough styles 2025-09-02 19:00:56 +01:00
Maria Shodunke
15c0c32429 Add JS README.md 2025-09-02 18:57:09 +01:00
Maria Shodunke
126cdbb00a Apply suggestions from code review
Co-authored-by: Rome Reginelli <rome@ripple.com>
2025-09-02 18:57:09 +01:00
Maria Shodunke
dff3298d60 Add improvements to walkthrough 2025-09-02 18:57:09 +01:00
Maria Shodunke
06b3c80ac7 Demo for code walkthrough functionality 2025-09-02 18:57:08 +01:00
tequ
8e3864e109 address reviews 2025-09-01 18:59:07 +09:00
tequ
d93a95e826 Merge remote-tracking branch 'upstream/master' into ja-ammclawback 2025-09-01 18:35:45 +09:00
tequ
b514ee4683 address reviews 2025-09-01 18:34:49 +09:00
tequ
4df68879cf Merge remote-tracking branch 'upstream/master' into ja-permissioned-dex 2025-09-01 18:29:12 +09:00
Rome Reginelli
456b607615 Merge pull request #3263 from XRPLF/rm_todo
Remove old/inadvertent TODO notes
2025-08-30 10:10:55 -07:00
mDuo13
0e67c48fb8 Remove old/inadvertent TODOs
Neither of these TODOs is relevant at the moment and they should not be
visible to readers (even in the HTML comments)
2025-08-29 13:45:43 -07:00
Rome Reginelli
3a548a5b69 Merge pull request #3233 from XRPLF/mpt_metadata_sample
Add sample code for XLS-89d MPT Metadata
2025-08-29 12:21:59 -07:00
oeggert
7b0ac8d3cb Merge pull request #3248 from XRPLF/rippled-2.6.0
2.6.0 Release Notes and Doc Updates
2025-08-28 18:12:42 -07:00
Oliver Eggert
646ed84d4c add reviewer suggestions 2025-08-28 18:06:29 -07:00
Oliver Eggert
1bd1099842 add package links and sha-256 2025-08-28 15:39:10 -07:00
Rome Reginelli
5b80dbd287 Merge pull request #3259 from XRPLF/events-updates-2025-08-27
Add new events: EasyA x Flare Harvard Hackathon and XRP Seoul Summit …
2025-08-28 13:20:39 -07:00
akcodez
082a9c37c4 update event imgae 2025-08-28 12:40:41 -07:00
akcodez
0269b7cef1 Fix missing newline at end of file in _light-theme.scss 2025-08-28 11:16:25 -07:00
akcodez
e86263472d rm export 2025-08-28 11:16:07 -07:00
akcodez
6164bfe7af Update CSS variables in devportal2024-v1.css for improved consistency
- Adjusted CSS variable definitions for better alignment with design standards.
- Ensured future styling adjustments can be made more easily.
2025-08-28 11:15:01 -07:00
Aria Keshmiri
636d986443 Update docs/use-cases/payments/index.page.tsx
Co-authored-by: Rome Reginelli <rome@ripple.com>
2025-08-28 11:14:45 -07:00
Aria Keshmiri
5cdb29c213 Update styles/_use-cases.scss
Co-authored-by: Rome Reginelli <rome@ripple.com>
2025-08-28 11:12:17 -07:00
akcodez
8f9ba68704 Enhance styling for tokenization page and update CSS variables
- Added padding to the developer tools section within the tokenization page for improved layout.
- Updated CSS variables in devportal2024-v1.css for consistency and future styling adjustments.
2025-08-28 11:07:57 -07:00
akcodez
ae71602d6d Update CSS and SCSS files for improved styling consistency
- Corrected the class name from `.fiipay` to `.friipay` in the _use-cases.scss file to ensure proper image rendering.
- No changes made to the devportal2024-v1.css file, but it remains updated for future styling adjustments.
2025-08-28 11:02:33 -07:00
Aria Keshmiri
6d9f2e6608 Update shared/components/project-cards.tsx
Co-authored-by: Rome Reginelli <rome@ripple.com>
2025-08-28 11:01:42 -07:00
Aria Keshmiri
52ccf12b03 Update docs/use-cases/payments/index.page.tsx
Co-authored-by: Rome Reginelli <rome@ripple.com>
2025-08-28 11:00:24 -07:00
Aria Keshmiri
aa55773044 Update styles/light/_light-theme.scss
Co-authored-by: Rome Reginelli <rome@ripple.com>
2025-08-28 11:00:17 -07:00
Aria Keshmiri
61559bd01c Update docs/use-cases/payments/index.page.tsx
Co-authored-by: Rome Reginelli <rome@ripple.com>
2025-08-28 11:00:11 -07:00
akcodez
fbb9a44e41 Update event descriptions for EasyA x Flare Harvard Hackathon and XRP Seoul Summit 2025 to enhance clarity and engagement. Adjust wording for XRP Community Night NYC to better reflect the event's purpose. 2025-08-28 10:24:55 -07:00
Rome Reginelli
5d2df48d81 Merge pull request #3255 from pkcs8/patch-4
Update account_lines.md - fixed the request parameter table
2025-08-27 13:54:27 -07:00
Rome Reginelli
9ba6d7b3db Merge pull request #3244 from XRPLF/ja-fix-wide-tables
[JA] Fix two issues with tables
2025-08-27 13:52:25 -07:00
akcodez
5c058bbaa2 Add new events: EasyA x Flare Harvard Hackathon and XRP Seoul Summit 2025. Update event details for XRP Community Night NYC, including date, location, and registration link. 2025-08-27 12:32:28 -07:00
Rome Reginelli
66db877765 Merge pull request #3258 from XRPLF/mvadari-patch-1
Fix binary-format.md link
2025-08-27 12:19:31 -07:00
mDuo13
9d8819cbf6 Migrate XLS-89d links to XLS-89 2025-08-27 12:09:01 -07:00
Mayukha Vadari
0fbd29cc56 Fix binary-format.md link 2025-08-26 17:19:18 -04:00
akcodez
13d0d1d653 rm commented styles 2025-08-26 10:50:58 -07:00
akcodez
023321d6de Enhance payments integration styles and layout for improved responsiveness
- Added max-width and margin adjustments to the payments integration section for better alignment on larger screens.
- Implemented responsive breakpoints for the payments integration section to ensure optimal display on medium and large devices.
- Introduced new styles for light mode payment logos and embedded payments icons, enhancing visual consistency across the payments page.
2025-08-26 10:49:22 -07:00
akcodez
12cf498d2b Refactor payments page layout and styles for improved responsiveness
- Simplified the hero section by removing unnecessary container classes.
- Adjusted padding and margins in the payments styles to enhance layout consistency across various screen sizes.
- Updated media queries to ensure better responsiveness for video content and typography on smaller devices.
2025-08-26 10:24:21 -07:00
akcodez
703f761a08 Enhance payments and tokenization pages with developer resources and layout improvements
- Integrated DeveloperResourcesSection into both payments and tokenization pages to provide developers with essential resources and community links.
- Updated payment URLs for various stablecoins to direct users to relevant external resources.
- Improved layout and styling for the payments integration section, ensuring better responsiveness and user experience.
- Refactored CSS for shared developer tools styles between payments and tokenization pages, enhancing visual consistency.
2025-08-26 10:15:53 -07:00
akcodez
9e2b88fbb8 Refactor payments and index pages to integrate BenefitsSection component
- Replaced the manual benefits list in the index page with the BenefitsSection component for improved maintainability.
- Added BenefitsSection to the payments page, showcasing embedded payment use cases with new card data.
- Updated ProjectCards component to support optional button text for enhanced project presentation.
- Introduced new CSS styles for embedded payments icons and battle-tested project cards for better visual consistency.
2025-08-26 07:38:18 -07:00
Maria Shodunke
caa48cb29c Merge pull request #3247 from XRPLF/related-topics-batch-3
Add related transactions and ledger entries (batch 3)
2025-08-26 09:56:57 +01:00
akcodez
e94a5a0269 Update payments and tokenization pages with new components and layout adjustments
- Changed the payments page to use `index.page.tsx` instead of `index.md` for better component integration.
- Added `AdvantagesSection` and `ProjectCards` components to both payments and tokenization pages to enhance content presentation.
- Adjusted CSS styles for improved responsiveness and layout consistency across different screen sizes.
- Removed outdated security card implementation in tokenization page and replaced it with a more streamlined advantages section.
2025-08-25 11:54:17 -07:00
Oliver Eggert
89cea53f33 remove mutex change 2025-08-25 11:23:48 -07:00
akcodez
2282eb86b6 adds basis 2025-08-25 09:18:57 -07:00
banasa44
0228e2e3c3 fix(docs): correct terminology from "GoLang" to "Go" in tutorial files, replace code snippets to references. 2025-08-25 14:58:14 +02:00
banasa44
31be92a37c chore(sample-docs): unify error handling with panic(err). 2025-08-25 12:44:07 +02:00
banasa44
162a97887e chore(code-samples): remove all emojis 2025-08-25 11:27:50 +02:00
Carles
22d67e640d Apply suggestions from code review
Co-authored-by: Maria Shodunke <maria-robobug@users.noreply.github.com>
Co-authored-by: oeggert <117319296+oeggert@users.noreply.github.com>
2025-08-25 10:58:26 +02:00
Anurag
b914ed71e3 Update account_lines.md - fixed the request parameter table
Removed erroneously appearing `UInt32` from the request parameter table. Also fixed table formatting.
2025-08-24 19:22:40 +00:00
akcodez
665d04396e add new layout for payments page 2025-08-22 11:50:48 -07:00
Rome Reginelli
64ed9cf3c2 Merge pull request #3254 from XRPLF/dependabot/npm_and_yarn/_code-samples/build-a-browser-wallet/js/sha.js-2.4.12
Bump sha.js from 2.4.11 to 2.4.12 in /_code-samples/build-a-browser-wallet/js
2025-08-21 16:35:36 -07:00
Rome Reginelli
3be171ba8d Merge pull request #3240 from XRPLF/fix_landing_blurbs
Fix landing blurbs
2025-08-21 14:59:34 -07:00
mDuo13
01f835c351 MPT metadata sample code: add lookup/decoding to example 2025-08-21 14:53:24 -07:00
Rome Reginelli
0dc8ff7a77 Apply suggestions from @maria-robobug review
Co-authored-by: Maria Shodunke <maria-robobug@users.noreply.github.com>
2025-08-21 11:56:35 -07:00
dependabot[bot]
9a2ae0f4b0 Bump sha.js in /_code-samples/build-a-browser-wallet/js
Bumps [sha.js](https://github.com/crypto-browserify/sha.js) from 2.4.11 to 2.4.12.
- [Changelog](https://github.com/browserify/sha.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crypto-browserify/sha.js/compare/v2.4.11...v2.4.12)

---
updated-dependencies:
- dependency-name: sha.js
  dependency-version: 2.4.12
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-21 15:45:41 +00:00
Maria Shodunke
eb6dba60a6 Merge pull request #3249 from XRPLF/related-topics-batch-4
Add related transactions and ledger entries (batch 4)
2025-08-21 11:12:47 +01:00
Oliver Eggert
451672ba59 update subscribe method with network_id field in ledger and validations stream 2025-08-20 15:06:27 -07:00
mDuo13
eb1fa6c1ee Refactor server_info/server_state response formatting slightly 2025-08-20 15:03:11 -07:00
Oliver Eggert
d4e8f44a10 add additional contributors 2025-08-20 14:53:28 -07:00
mDuo13
85eec21d31 Clarify network_ledger field & remove reporting mode fields 2025-08-20 14:36:25 -07:00
Chenna Keshava B S
8f3a31be92 specify information about network_ledger field in server_info response 2025-08-20 14:36:24 -07:00
Oliver Eggert
04dfd61fd7 update contributors to github accounts 2025-08-20 11:23:33 -07:00
Maria Shodunke
c78e0f8727 Add related transactions and ledger entries (batch 4)
Fixes https://github.com/XRPLF/xrpl-dev-portal/issues/3220

- Adds related topics to the ledger entry and transaction type pages.

Preview [here]()

Related PRs:
- Batch 1: https://github.com/XRPLF/xrpl-dev-portal/pull/3235
- Batch 2: https://github.com/XRPLF/xrpl-dev-portal/pull/3246
- Batch 3: https://github.com/XRPLF/xrpl-dev-portal/pull/3247

Batch 4 covers:

- [x] PermissionedDomain + transactions
- [x] RippleState + transactions
- [x] SignerList + transactions
- [x] Ticket + transactions
- [x] XChainOwnedClaimID + transactions
- [x] XChainOwnedCreateAccountClaimID + transactions
2025-08-20 14:03:13 +01:00
Maria Shodunke
77b44d4e7a Merge pull request #3246 from XRPLF/related-topics-batch-2
Add related transactions and ledger entries (batch 2)
2025-08-20 11:09:01 +01:00
Oliver Eggert
f5c4ebaa00 update known amendments 2025-08-19 17:20:04 -07:00
Oliver Eggert
d0eec81648 add release notes up to rc2 2025-08-19 17:00:07 -07:00
Maria Shodunke
a70da89a7d Add related transactions and ledger entries (batch 3)
Fixes https://github.com/XRPLF/xrpl-dev-portal/issues/3220

- Adds related topics to the ledger entry and transaction type pages.

Preview [here](https://xrpl-dev-portal--related-topics-batch-2.preview.redocly.app/docs/references/protocol/ledger-data/ledger-entry-types/delegate)

- Batch 1: https://github.com/XRPLF/xrpl-dev-portal/pull/3235
- Batch 2: https://github.com/XRPLF/xrpl-dev-portal/pull/3246

Batch 3 covers:

- [x] MPTokenIssuance + transactions
- [x] NFTokenOffer + transactions
- [x] Offer + transactions
- [x] Oracle + transactions
- [x] PayChannel + transactions
2025-08-19 17:50:13 +01:00
Maria Shodunke
9ea2b13c4c Add related transactions and ledger entries (batch 2) 2025-08-19 13:49:39 +01:00
mDuo13
ca66b36ce8 [JA] Fix broken table syntax 2025-08-18 12:12:25 -07:00
mDuo13
e61ddb1984 Fix unnecessary horizontal scrolling of tables in Japanese 2025-08-18 12:09:43 -07:00
tequ
cee145229b [JA] Permissioned DEXes 2025-08-18 15:18:07 +09:00
tequ
df38740883 address #2969, other fixes 2025-08-18 12:27:25 +09:00
mDuo13
c95613261f Use seo.description instead of blurb in index pages 2025-08-15 13:20:13 -07:00
mDuo13
468c8d3a47 Improve consistency of descriptions in frontmatter 2025-08-15 13:19:49 -07:00
Rome Reginelli
94686086ee Merge pull request #3237 from XRPLF/update_account_objects
Update account_objects docs
2025-08-15 12:19:27 -07:00
Rome Reginelli
207e50caa2 Merge pull request #3226 from XRPLF/mvadari-patch-1
Update feesettings.md
2025-08-15 12:19:03 -07:00
mDuo13
985a47a4bb FeeSettings - fix typos 2025-08-15 12:08:06 -07:00
mDuo13
30e6767f58 Update account objects, ledger_data w/ separate list of short types 2025-08-14 14:49:26 -07:00
mDuo13
6947fccf57 Add compact option for amendment-disclaimer 2025-08-14 14:48:46 -07:00
Rome Reginelli
bab45a105d Merge pull request #3229 from XRPLF/fix_api_versioning_links
Fix API v2 links & revise API versioning section slightly
2025-08-14 13:39:06 -07:00
Rome Reginelli
31e9682f81 Merge pull request #3236 from XRPLF/fix_blog_case_study_category
Fix blog landing bugs & add case study category
2025-08-14 11:49:45 -07:00
Maria Shodunke
d903bf9c2a Merge pull request #3235 from XRPLF/related-topics-batch-1
Add related transactions and ledger entries (batch 1)
2025-08-14 19:49:09 +01:00
Maria Shodunke
8617ed2642 Update common-links 2025-08-14 19:38:32 +01:00
mDuo13
e12e40a926 Fix blog landing bugs & add case study category 2025-08-14 11:38:07 -07:00
Amarantha Kulkarni
0eadc32085 Merge pull request #3232 from XRPLF/seo-jul2025
SEO recommendations for concept topics added in rippled 2.5.0
2025-08-14 11:29:26 -07:00
Maria Shodunke
3b7d66ee7e Add related transactions and ledger entries 2025-08-14 18:58:29 +01:00
Mayukha Vadari
8fc4d8fa6d respond to comments 2025-08-14 13:03:06 -04:00
mDuo13
6c16fa1611 Add sample code for XLS-89d MPT Metadata 2025-08-12 17:03:13 -07:00
Amarantha Kulkarni
a2cfcb2dbc Apply suggestions from code review
Co-authored-by: Rome Reginelli <rome@ripple.com>
2025-08-12 16:28:43 -07:00
Amarantha Kulkarni
2b8673c355 Update docs/concepts/tokens/decentralized-exchange/permissioned-dexes.md
Co-authored-by: Rome Reginelli <rome@ripple.com>
2025-08-12 16:23:50 -07:00
amarantha-k
ba4750d2cc Fix broken links 2025-08-12 12:53:45 -07:00
amarantha-k
a638266581 Incorporate SEO recommendations 2025-08-12 12:31:17 -07:00
amarantha-k
1e7ab3ea5c Recommended SEO updates 2025-08-12 12:30:28 -07:00
Rome Reginelli
aec8b0f007 Merge pull request #3227 from mDuo13/amendment-disclaimer
Amendment disclaimer
2025-08-12 11:26:17 -07:00
mDuo13
d58ddaf13a Fix API v2 links & revise API versioning section slightly 2025-08-07 18:53:14 -07:00
Rome Reginelli
98684cc3a1 AmendmentDisclaimer: remove vestigial isVoting attribute
Co-authored-by: tequ <git@tequ.dev>
2025-08-07 13:25:30 -07:00
mDuo13
e3ec322c8f AmendmentDisclaimer: fetch status dynamically 2025-08-05 15:02:06 -07:00
Mayukha Vadari
c68bc530b2 Update feesettings.md 2025-08-05 17:23:03 -04:00
Mayukha Vadari
72325730c3 Update feesettings.md 2025-08-05 17:21:59 -04:00
tequ
97c692c767 Add AmendmentDisclaimer component 2025-08-05 14:11:07 -07:00
banasa44
e1153eb008 chore(samples): replace tab for 4 spaces 2025-07-23 10:51:03 +02:00
banasa44
6de921ccfb feat(samples): add go examples, secure signing and send a memo 2025-07-22 18:13:00 +02:00
banasa44
1009242c6a chore(docs): small fixes 2025-07-22 17:29:26 +02:00
banasa44
0ab859343d chore(docs): small fixes 2025-07-22 17:28:54 +02:00
banasa44
79ed25b125 chore(docs): small style and comments changes and fixes 2025-07-22 17:08:38 +02:00
banasa44
2aa7d5f4cc chore(docs): small fixes/changes in go tutorials docs 2025-07-22 11:59:29 +02:00
banasa44
2e45eb7860 refactor(_code-samples): move use-tickets example 2025-07-22 11:42:20 +02:00
banasa44
7baaa03c2d refactor(_code-samples): remove README.md file from code samples 2025-07-22 11:30:33 +02:00
banasa44
82b976905e feat(docs): add xrpl-go GoLang package to XRPLF documentation site 2025-07-22 11:15:48 +02:00
banasa44
7e700c05b4 feat(docs): add GoLang tutorial link and logo to the documentation index 2025-07-22 09:28:07 +02:00
banasa44
d9700399eb refactor(_code-samples): remove Go WebSocket use-ticket example 2025-07-21 12:35:57 +02:00
banasa44
877ed4e980 feat(_code-samples): WiP add go tx examples implementation and get-started section 2025-07-21 11:47:33 +02:00
banasa44
ff5b5ab258 feat(_code-samples): WiP add go tx examples implementation 2025-07-17 16:03:19 +02:00
banasa44
61dd7a8c2d feat(_code-samples): WiP add tx examples skeleton 2025-07-17 12:02:18 +02:00
351 changed files with 14715 additions and 3174 deletions

View File

@@ -1,7 +1,6 @@
---
html: deleting-accounts.html
parent: accounts.html
blurb: Acerca de eliminar una cuenta XRP Ledger.
seo:
description: Acerca de eliminar una cuenta XRP Ledger.
labels:
- Cuentas
---

View File

@@ -1,7 +1,6 @@
---
html: consensus-protections.html
parent: consensus.html
blurb: Aprende cómo el Protocolo de Consenso del XRP Ledger se protege contra varios problemas y ataques que pueden ocurrir en un sistema financiero descentralizado.
seo:
description: Aprende cómo el Protocolo de Consenso del XRP Ledger se protege contra varios problemas y ataques que pueden ocurrir en un sistema financiero descentralizado.
labels:
- Blockchain
---

View File

@@ -4,6 +4,7 @@
[AMMオブジェクト]: /@l10n/ja/docs/references/protocol/ledger-data/ledger-entry-types/amm.md
[AMMBid]: /@l10n/ja/docs/references/protocol/transactions/types/ammbid.md
[AMMBidトランザクション]: /@l10n/ja/docs/references/protocol/transactions/types/ammbid.md
[AMMClawbackトランザクション]: /@l10n/ja/docs/references/protocol/transactions/types/ammclawback.md
[AMMCreate]: /@l10n/ja/docs/references/protocol/transactions/types/ammcreate.md
[AMMCreateトランザクション]: /@l10n/ja/docs/references/protocol/transactions/types/ammcreate.md
[AMMDelete]: /@l10n/ja/docs/references/protocol/transactions/types/ammdelete.md
@@ -14,8 +15,8 @@
[AMMVoteトランザクション]: /@l10n/ja/docs/references/protocol/transactions/types/ammvote.md
[AMMWithdraw]: /@l10n/ja/docs/references/protocol/transactions/types/ammwithdraw.md
[AMMWithdrawトランザクション]: /@l10n/ja/docs/references/protocol/transactions/types/ammwithdraw.md
[API v1]: /@l10n/ja/docs/references/http-websocket-apis/api-conventions/request-formatting.md#api-versioning
[API v2]: /@l10n/ja/docs/references/http-websocket-apis/api-conventions/request-formatting.md#api-versioning
[API v1]: /@l10n/ja/docs/references/http-websocket-apis/index.md
[API v2]: /@l10n/ja/docs/references/http-websocket-apis/index.md
[AccountDelete]: /@l10n/ja/docs/references/protocol/transactions/types/accountdelete.md
[AccountDeleteトランザクション]: /@l10n/ja/docs/references/protocol/transactions/types/accountdelete.md
[AccountRootエントリ]: /@l10n/ja/docs/references/protocol/ledger-data/ledger-entry-types/accountroot.md
@@ -148,6 +149,7 @@
[PermissionDelegation amendment]: /@l10n/ja/resources/known-amendments.md#permissiondelegation
[PermissionedDEX amendment]: /@l10n/ja/resources/known-amendments.md#permissioneddex
[PermissionedDomains amendment]: /@l10n/ja/resources/known-amendments.md#permissioneddomains
[PermissionedDomainSetトランザクション]: /@l10n/ja/docs/references/protocol/transactions/types/permissioneddomainset.md
[許可型ドメイン]: /@l10n/ja/docs/concepts/tokens/decentralized-exchange/permissioned-domains.md
[PriceOracle amendment]: /@l10n/ja/resources/known-amendments.md#priceoracle
[MPTokensV1_1 amendment]: /@l10n/ja/resources/known-amendments.md#priceoracle
@@ -173,7 +175,7 @@
[通貨額の指定]: /@l10n/ja/docs/references/protocol/data-types/basic-data-types.md#通貨額の指定
[レジャーの指定]: /@l10n/ja/docs/references/protocol/data-types/basic-data-types.md#レジャーの指定
[時間の指定]: /@l10n/ja/docs/references/protocol/data-types/basic-data-types.md#時間の指定
[Specifying Without Amounts]: /@l10n/ja/docs/references/protocol/data-types/currency-formats.md#specifying-without-amounts
[金額なしの指定]: /@l10n/ja/docs/references/protocol/data-types/currency-formats.md#金額なしでの通貨の指定
[SusPay amendment]: /@l10n/ja/resources/known-amendments.md#suspay
[TickSize amendment]: /@l10n/ja/resources/known-amendments.md#ticksize
[Ticketエントリ]: /@l10n/ja/docs/references/protocol/ledger-data/ledger-entry-types/ticket.md

View File

@@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
<svg fill-opacity="1" xmlns:xlink="http://www.w3.org/1999/xlink" color-rendering="auto" color-interpolation="auto" text-rendering="auto" stroke="black" stroke-linecap="square" width="630" stroke-miterlimit="10" shape-rendering="auto" stroke-opacity="1" fill="black" stroke-dasharray="none" font-weight="normal" stroke-width="1" viewBox="0 0 630 460" height="460" xmlns="http://www.w3.org/2000/svg" font-family="'Dialog'" font-style="normal" stroke-linejoin="miter" font-size="12px" stroke-dashoffset="0" image-rendering="auto"
><!--Generated by the Batik Graphics2D SVG Generator--><defs id="genericDefs"
/><g
><defs id="defs1"
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath1"
><path d="M0 0 L2147483647 0 L2147483647 2147483647 L0 2147483647 L0 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath2"
><path d="M0 0 L0 140 L160 140 L160 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath3"
><path d="M0 0 L0 140 L200 140 L200 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath4"
><path d="M0 0 L0 140 L190 140 L190 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath5"
><path d="M0 0 L0 80 L140 80 L140 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath6"
><path d="M0 0 L0 40 L110 40 L110 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath7"
><path d="M0 0 L0 30 L120 30 L120 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath8"
><path d="M0 0 L0 180 L270 180 L270 0 Z"
/></clipPath
></defs
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(450,300)" stroke-opacity="0" stroke="rgb(255,255,255)"
><circle r="7" clip-path="url(#clipPath2)" cx="80.5" cy="7.5" stroke="none"
/></g
><g transform="translate(450,300)"
><circle fill="none" r="7" clip-path="url(#clipPath2)" cx="80.5" cy="7.5"
/><path fill="none" d="M59.5 21.5 L101.5 21.5" clip-path="url(#clipPath2)"
/><path fill="none" d="M80.5 14.5 L80.5 42.5" clip-path="url(#clipPath2)"
/><path fill="none" d="M80.5 42.5 L66.5 70.5" clip-path="url(#clipPath2)"
/><path fill="none" d="M80.5 42.5 L94.5 70.5" clip-path="url(#clipPath2)"
/><text x="60" font-size="14px" y="93.1094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>Tracy</text
><text x="25" font-size="14px" y="109.2188" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>(許可型DEXの</text
><text x="33" font-size="14px" y="125.3281" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>トレーダー)</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(20,20)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="198.5" height="138.5" y="0.5" clip-path="url(#clipPath3)" stroke="none"
/></g
><g transform="translate(20,20)"
><rect fill="none" x="0.5" width="198.5" height="138.5" y="0.5" clip-path="url(#clipPath3)"
/><text x="60" font-size="14px" y="18.1094" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>オーダーブック</text
><text x="11" font-size="14px" y="34.2188" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>USD.Acme:FOO.WayGate</text
><path fill="none" d="M1 40.2188 L199 40.2188" clip-path="url(#clipPath3)"
/><text x="5" font-size="14px" y="55.3281" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" font-weight="bold" xml:space="preserve"
>DomainID: ドメインA</text
><path fill="none" d="M1 61.3281 L199 61.3281" clip-path="url(#clipPath3)"
/><text x="5" font-size="14px" y="76.4375" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>10 FOO : 10 USD Marko</text
><path fill="none" d="M1 82.4375 L199 82.4375" clip-path="url(#clipPath3)"
/><text x="5" font-size="14px" y="97.5469" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>9 FOO : 15 USD Tracy</text
><path fill="none" d="M1 103.5469 L199 103.5469" clip-path="url(#clipPath3)"
/><text x="5" font-size="14px" y="118.6562" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>...</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(290,60)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="188.5" height="138.5" y="0.5" clip-path="url(#clipPath4)" stroke="none"
/></g
><g transform="translate(290,60)"
><rect fill="none" x="0.5" width="188.5" height="138.5" y="0.5" clip-path="url(#clipPath4)"
/><text x="60" font-size="14px" y="18.1094" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>ドメインA</text
><path fill="none" d="M1 24.1094 L189 24.1094" clip-path="url(#clipPath4)"
/><text x="5" font-size="14px" y="39.2188" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>所有者: Owen</text
><text x="5" font-size="14px" y="55.3281" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>承認された資格情報:</text
><text x="5" font-size="14px" y="71.4375" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>- "認可済" by Isabel</text
><text x="5" font-size="14px" y="87.5469" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
></text
><text x="5" font-size="14px" y="103.6562" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" font-weight="bold" xml:space="preserve"
>- "認可済" by Owen</text
><text x="5" font-size="14px" y="119.7656" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" font-weight="bold" xml:space="preserve"
></text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(120,300)" stroke-opacity="0" stroke="rgb(255,255,255)"
><circle r="7" clip-path="url(#clipPath2)" cx="80.5" cy="7.5" stroke="none"
/></g
><g transform="translate(120,300)"
><circle fill="none" r="7" clip-path="url(#clipPath2)" cx="80.5" cy="7.5"
/><path fill="none" d="M59.5 21.5 L101.5 21.5" clip-path="url(#clipPath2)"
/><path fill="none" d="M80.5 14.5 L80.5 42.5" clip-path="url(#clipPath2)"
/><path fill="none" d="M80.5 42.5 L66.5 70.5" clip-path="url(#clipPath2)"
/><path fill="none" d="M80.5 42.5 L94.5 70.5" clip-path="url(#clipPath2)"
/><text x="60" font-size="14px" y="93.1094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>Owen</text
><text x="19" font-size="14px" y="109.2188" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>(資格情報の発行者</text
><text x="11" font-size="14px" y="125.3281" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>かつドメインの所有者)</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(300,290)" stroke-opacity="0" stroke="rgb(255,255,255)"
><path d="M0.5 0.5 L80.7725 0.5 L80.7725 21.6094 L139 21.6094 L139 79 L0.5 79 Z" stroke="none" clip-path="url(#clipPath5)"
/></g
><g transform="translate(300,290)"
><path fill="none" d="M0.5 0.5 L80.7725 0.5 L80.7725 21.6094 L139 21.6094 L139 79 L0.5 79 Z" clip-path="url(#clipPath5)"
/><path fill="none" d="M0.5 21.6094 L80.7725 21.6094" clip-path="url(#clipPath5)"
/><text x="5" font-size="14px" y="16.1094" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>資格情報</text
><text x="5" font-size="14px" y="39.5" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>タイプ: "認可済"</text
><text x="5" font-size="14px" y="55.6094" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>発行者: Owen</text
><text x="5" font-size="14px" y="71.7188" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>対象: Tracy</text
></g
><g stroke-dasharray="8,5" stroke-miterlimit="5" transform="translate(430,310)" stroke-linecap="butt"
><path fill="none" d="M90.5 20.5 L11.5 20.5" clip-path="url(#clipPath6)"
/><path fill="white" d="M22.2583 14 L11 20.5 L22.2583 27 Z" clip-path="url(#clipPath6)" stroke="none"
/><path fill="none" stroke-miterlimit="10" stroke-dasharray="none" d="M22.2583 14 L11 20.5 L22.2583 27 Z" clip-path="url(#clipPath6)" stroke-linecap="square"
/></g
><g font-family="sans-serif" font-size="14px" transform="translate(430,310)"
><text x="32.2207" xml:space="preserve" y="16" clip-path="url(#clipPath6)" stroke="none"
>保有</text
></g
><g stroke-dasharray="8,5" stroke-miterlimit="5" transform="translate(190,60)" stroke-linecap="butt"
><path fill="none" d="M99.5 10.5 L10.5 10.5" clip-path="url(#clipPath7)"
/><path fill="white" d="M88.7417 4 L100 10.5 L88.7417 17 Z" clip-path="url(#clipPath7)" stroke="none"
/><path fill="none" stroke-miterlimit="10" stroke-dasharray="none" d="M88.7417 4 L100 10.5 L88.7417 17 Z" clip-path="url(#clipPath7)" stroke-linecap="square"
/></g
><g stroke-dasharray="8,5" stroke-miterlimit="5" transform="translate(170,150)" stroke-linecap="butt"
><path fill="none" d="M10.5 11.5 L10.5 40.5" clip-path="url(#clipPath8)"
/><path fill="none" d="M10.5 40.5 L230.5 40.5" clip-path="url(#clipPath8)"
/><path fill="none" d="M230.5 40.5 L230.5 150.5" clip-path="url(#clipPath8)"
/><path fill="none" d="M230.5 150.5 L250.5 160.5" clip-path="url(#clipPath8)"
/><path fill="white" d="M4 22.2583 L10.5 11 L17 22.2583 Z" clip-path="url(#clipPath8)" stroke="none"
/><path fill="none" stroke-miterlimit="10" stroke-dasharray="none" d="M4 22.2583 L10.5 11 L17 22.2583 Z" clip-path="url(#clipPath8)" stroke-linecap="square"
/></g
><g font-family="sans-serif" font-size="14px" transform="translate(170,150)"
><text x="14" xml:space="preserve" y="55.2188" clip-path="url(#clipPath8)" stroke="none"
>アクセス許可</text
></g
><g stroke-dasharray="8,5" stroke-miterlimit="5" transform="translate(210,310)" stroke-linecap="butt"
><path fill="none" d="M89.5 20.5 L10.5 20.5" clip-path="url(#clipPath6)"
/><path fill="white" d="M78.7417 14 L90 20.5 L78.7417 27 Z" clip-path="url(#clipPath6)" stroke="none"
/><path fill="none" stroke-miterlimit="10" stroke-dasharray="none" d="M78.7417 14 L90 20.5 L78.7417 27 Z" clip-path="url(#clipPath6)" stroke-linecap="square"
/></g
><g font-family="sans-serif" font-size="14px" transform="translate(210,310)"
><text x="29.3696" xml:space="preserve" y="16" clip-path="url(#clipPath6)" stroke="none"
>発行</text
></g
></g
></svg
>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
<svg fill-opacity="1" xmlns:xlink="http://www.w3.org/1999/xlink" color-rendering="auto" color-interpolation="auto" text-rendering="auto" stroke="black" stroke-linecap="square" width="810" stroke-miterlimit="10" shape-rendering="auto" stroke-opacity="1" fill="black" stroke-dasharray="none" font-weight="normal" stroke-width="1" viewBox="0 10 810 330" height="330" xmlns="http://www.w3.org/2000/svg" font-family="'Dialog'" font-style="normal" stroke-linejoin="miter" font-size="12px" stroke-dashoffset="0" image-rendering="auto"
><!--Generated by the Batik Graphics2D SVG Generator--><defs id="genericDefs"
/><g
><defs id="defs1"
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath1"
><path d="M0 0 L2147483647 0 L2147483647 2147483647 L0 2147483647 L0 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath2"
><path d="M0 0 L0 70 L110 70 L110 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath3"
><path d="M0 0 L0 290 L250 290 L250 0 Z"
/></clipPath
></defs
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(670,240)" stroke-opacity="0" stroke="rgb(255,255,255)"
><path d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" stroke="none" clip-path="url(#clipPath2)"
/></g
><g transform="translate(670,240)"
><path fill="none" d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" clip-path="url(#clipPath2)"
/><path fill="none" d="M0.5 21.6094 L88.998 21.6094" clip-path="url(#clipPath2)"
/><text x="5" font-size="12px" y="16.1094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>オーダーブック</text
><text x="27" font-size="14px" y="42.5547" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>EUR:JPY</text
><text x="10" font-size="14px" y="58.6641" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>DomainID: B</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(550,240)" stroke-opacity="0" stroke="rgb(255,255,255)"
><path d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" stroke="none" clip-path="url(#clipPath2)"
/></g
><g transform="translate(550,240)"
><path fill="none" d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" clip-path="url(#clipPath2)"
/><path fill="none" d="M0.5 21.6094 L88.998 21.6094" clip-path="url(#clipPath2)"
/><text x="5" font-size="12px" y="16.1094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>オーダーブック</text
><text x="27" font-size="14px" y="42.5547" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>JPY:EUR</text
><text x="10" font-size="14px" y="58.6641" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>DomainID: B</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(280,30)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="248.5" height="288.5" y="0.5" clip-path="url(#clipPath3)" stroke="none"
/></g
><g stroke-dasharray="8,5" stroke-miterlimit="5" transform="translate(280,30)" stroke-linecap="butt"
><rect fill="none" x="0.5" width="248.5" height="288.5" y="0.5" clip-path="url(#clipPath3)"
/><text x="54" font-size="14px" y="18.1094" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>許可型DEX A</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(30,160)" stroke-opacity="0" stroke="rgb(255,255,255)"
><path d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" stroke="none" clip-path="url(#clipPath2)"
/></g
><g transform="translate(30,160)"
><path fill="none" d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" clip-path="url(#clipPath2)"
/><path fill="none" d="M0.5 21.6094 L88.998 21.6094" clip-path="url(#clipPath2)"
/><text x="5" font-size="12px" y="16.1094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>オーダーブック</text
><text x="22" font-size="14px" y="50.6094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>USD:FOO</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(30,240)" stroke-opacity="0" stroke="rgb(255,255,255)"
><path d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" stroke="none" clip-path="url(#clipPath2)"
/></g
><g transform="translate(30,240)"
><path fill="none" d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" clip-path="url(#clipPath2)"
/><path fill="none" d="M0.5 21.6094 L88.998 21.6094" clip-path="url(#clipPath2)"
/><text x="5" font-size="12px" y="16.1094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>オーダーブック</text
><text x="23" font-size="14px" y="50.6094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>BAR:BAZ</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(150,160)" stroke-opacity="0" stroke="rgb(255,255,255)"
><path d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" stroke="none" clip-path="url(#clipPath2)"
/></g
><g transform="translate(150,160)"
><path fill="none" d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" clip-path="url(#clipPath2)"
/><path fill="none" d="M0.5 21.6094 L88.998 21.6094" clip-path="url(#clipPath2)"
/><text x="5" font-size="12px" y="16.1094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>オーダーブック</text
><text x="22" font-size="14px" y="50.6094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>FOO:USD</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(150,80)" stroke-opacity="0" stroke="rgb(255,255,255)"
><path d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" stroke="none" clip-path="url(#clipPath2)"
/></g
><g transform="translate(150,80)"
><path fill="none" d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" clip-path="url(#clipPath2)"
/><path fill="none" d="M0.5 21.6094 L88.998 21.6094" clip-path="url(#clipPath2)"
/><text x="5" font-size="12px" y="16.1094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>オーダーブック</text
><text x="23" font-size="14px" y="50.6094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>FOO:XRP</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(30,80)" stroke-opacity="0" stroke="rgb(255,255,255)"
><path d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" stroke="none" clip-path="url(#clipPath2)"
/></g
><g transform="translate(30,80)"
><path fill="none" d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" clip-path="url(#clipPath2)"
/><path fill="none" d="M0.5 21.6094 L88.998 21.6094" clip-path="url(#clipPath2)"
/><text x="5" font-size="12px" y="16.1094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>オーダーブック</text
><text x="23" font-size="14px" y="50.6094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>XRP:FOO</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(20,30)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="248.5" height="288.5" y="0.5" clip-path="url(#clipPath3)" stroke="none"
/></g
><g stroke-dasharray="8,5" stroke-miterlimit="5" transform="translate(20,30)" stroke-linecap="butt"
><rect fill="none" x="0.5" width="248.5" height="288.5" y="0.5" clip-path="url(#clipPath3)"
/><text x="89" font-size="14px" y="18.1094" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>オープンDEX</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(410,240)" stroke-opacity="0" stroke="rgb(255,255,255)"
><path d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" stroke="none" clip-path="url(#clipPath2)"
/></g
><g transform="translate(410,240)"
><path fill="none" d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" clip-path="url(#clipPath2)"
/><path fill="none" d="M0.5 21.6094 L88.998 21.6094" clip-path="url(#clipPath2)"
/><text x="5" font-size="12px" y="16.1094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>オーダーブック</text
><text x="27" font-size="14px" y="42.5547" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>EUR:JPY</text
><text x="11" font-size="14px" y="58.6641" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>DomainID: A</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(290,160)" stroke-opacity="0" stroke="rgb(255,255,255)"
><path d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" stroke="none" clip-path="url(#clipPath2)"
/></g
><g transform="translate(290,160)"
><path fill="none" d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" clip-path="url(#clipPath2)"
/><path fill="none" d="M0.5 21.6094 L88.998 21.6094" clip-path="url(#clipPath2)"
/><text x="5" font-size="12px" y="16.1094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>オーダーブック</text
><text x="22" font-size="14px" y="42.5547" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>USD:FOO</text
><text x="11" font-size="14px" y="58.6641" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>DomainID: A</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(410,80)" stroke-opacity="0" stroke="rgb(255,255,255)"
><path d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" stroke="none" clip-path="url(#clipPath2)"
/></g
><g transform="translate(410,80)"
><path fill="none" d="M0.5 0.5 L88.998 0.5 L88.998 21.6094 L109 21.6094 L109 69 L0.5 69 Z" clip-path="url(#clipPath2)"
/><path fill="none" d="M0.5 21.6094 L88.998 21.6094" clip-path="url(#clipPath2)"
/><text x="5" font-size="12px" y="16.1094" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>オーダーブック</text
><text x="23" font-size="14px" y="42.5547" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>FOO:XRP</text
><text x="11" font-size="14px" y="58.6641" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>DomainID: A</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(540,30)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="248.5" height="288.5" y="0.5" clip-path="url(#clipPath3)" stroke="none"
/></g
><g stroke-dasharray="8,5" stroke-miterlimit="5" transform="translate(540,30)" stroke-linecap="butt"
><rect fill="none" x="0.5" width="248.5" height="288.5" y="0.5" clip-path="url(#clipPath3)"
/><text x="54" font-size="14px" y="18.1094" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>許可型DEX B</text
></g
></g
></svg
>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,113 @@
---
seo:
description: 許可型メインインスタンスの定義と詳細について
labels:
- コンプライアンス
- 分散型取引所
---
# 許可型DEX
許可型DEXは、XRP Ledgerの[分散型取引所(DEX)](./index.md)内での取引を制御する環境です。許可型DEXでの取引は、オープンDEXと同様ですが、[_許可型ドメイン_](./permissioned-domains.md)によって誰がオファーを置くことができるか、またはオファーを受け入れることができるかを制御します。許可型DEXを利用することで、規制下にある企業はXRP Ledgerでの取引に参加し、取引先のすべての相手方が適切に検証されていることを確認することができます。
XRP Ledgerブロックチェーン内には、複数の許可型DEXが存在することができます。それぞれは、許可型ドメインと関連付けられており、そのDEXへのアクセスを許可するリストとして機能します。許可型DEX内に置かれた取引は、同じ許可型DEX内の他の取引にのみ実行できます。各許可型DEXは、必要に応じて、任意の数の通貨ペアの注文帳を持つことができます。
## 背景: 許可型DEXの必要性
XRP Ledgerは、ローンチ以来、単一の、_オープンDEX_ を持っています。XRPLアカウントを持っていれば誰でもこのDEXで取引することができ、システムは誰がオファーを作成したに関係なく、マッチングする注文、もしくはオファーを自動的に約定します。注文はまた、クロスカレンシー支払いに流動性を提供し、潜在的に1つのアトミック取引の一部として複数の取引を実行することができます。
システムは、アカウントの背後にある人々や組織について何も知らないため、ある取引の相手方が誰かは確実ではありません。しかし、経済制裁や金融規制は、犯罪者、テロリスト、または特定の国との取引に対して厳格なルールを課しています。これらの制限により、規制下にある金融機関は、オープンDEXでの取引に対するリスクを負うことを望んでいないかもしれません。
さらなる背景情報:
- [分散型取引所](./index.md)
- [オファー](./offers.md)
- [許可型ドメイン](./permissioned-domains.md)
## 許可型DEXの重要な役割
許可型DEXを使用するには、以下の役割と責任を持つ参加者が必要です。
- 少なくとも2人のトレーダーがマッチングするオファーを置く必要があります。例えば、1人がXRPをUSDに交換し、もう1人がUSDをXRPに交換します。
- 許可型ドメインの所有者。許可型ドメインへのアクセスを許可する資格情報を制御します。
- 資格情報(Credentials)の発行者。許可型ドメインへのアクセスを許可する資格情報を発行します。
1つのアカウントがこれらの役割のいずれかを複数回果たすことができます。例えば、許可型ドメインの所有者、資格情報の発行者、およびトレーダーの3つの役割を同時に果たすことができます。唯一の制限は、トレーダーが異なるアカウントである必要があることです。
{% inline-svg file="./permissioned-dex-roles.svg" /%}
_図: 許可型オーダーブック。Owenは許可型ドメインの所有者であり、許可型ドメインの承認された資格情報の1つの発行者です。TracyはOwenが発行した適切な資格情報を保有しているため、許可型オーダーブックで取引することができます。_
## 許可型DEXの構造を理解する: オファーの種類と相互作用
許可型DEX機能を使用すると、取引オファーは _オープン_、_許可型_、または _ハイブリッド_ のいずれかになります。
### オープンオファー
オープンオファーはオープンDEXを使用し、他のオープンなオファー、ハイブリッドなオファー、[自動マーケットメーカー(AMM)](./automated-market-makers.md)、またはオファーとAMMの組み合わせによってマッチングすることができます。_オープンオファー_ は、許可型DEXがない場合のXRPLのDEXの動作と変わりません。
### 許可型オファー
許可型オファーはドメインIDを指定し、そのドメインIDに一致する許可型ドメインが存在し、オファーを置いたアカウントがそのドメインにアクセスできる場合にのみ有効です。許可型オファーは、指定されたドメインと通貨ペアのオーダーブックに配置され、オープンDEXのオーダーブックとは別です。
許可型オファーは、同じドメインIDを指定する許可型オファーとのみマッチングすることができます。[クロスカレンシー支払い](../../payment-types/cross-currency-payments.md)もドメインIDを指定することができ、その場合は、対応する許可型DEXからのみオファーを約定するように制限されます。許可型DEX内の取引は、必要な注文がすべて同じ許可型DEX内に存在する限り、[オートブリッジング](./autobridging.md)を使用することができます。
### ハイブリッドオファー
ハイブリッドオファーはドメインIDを指定し、ハイブリッドフラグを付けます。許可型オファーと同様に、指定された許可型ドメインが存在し、オファーを置いたアカウントがそのドメインにアクセスできる場合にのみ有効です。ただし、ハイブリッドオファーは、指定されたDEXとオープンDEXの両方でオファーをマッチングすることができます。
ハイブリッドオファーは、オープンDEXのオーダーブックと、その通貨ペアの許可型ドメイン固有のオーダーブックの両方で追跡され、どちらかのオファーとマッチングすることができます。配置された場合、許可型DEXのオファーと優先的にマッチングします。
### オープン、ハイブリッド、許可型オファーのマッチング方法
要約すると、以下の表に、どのオファーがマッチングできるかをまとめています:
| オファー/支払いタイプ | オープンオファー | ハイブリッドオファー | 許可型オファー | AMM |
|-----------------------|------------------|----------------------|-------------------|-----|
| オープン | ✅ | ✅ | ❌ | ✅ |
| ハイブリッド | ✅ | ✅ | ✅ (同じドメイン) | ✅ |
| 許可型 | ❌ | ❌ | ✅ (同じドメイン) | ❌ |
許可型DEXを表すための単一のレジャーエントリはありません。 それは暗黙的に、同じドメインIDを持つすべてのオーダーブックとして存在します。指定されたドメインIDを使用して有効なオファーが配置されると、そのオーダーブックが作成され、空になると自動的に削除されます。
1つのトランザクションは、同じドメインIDを持つ複数のオーダーブックを使用できます。つまり、同じ許可型DEX内の異なる通貨ペアです。それは、長い[クロスカレンシー支払い](../../payment-types/cross-currency-payments.md)の一部として、またはオートブリッジングを介して使用することができます。ハイブリッドオファーは、許可型オファーとオープンオファーの混合をマッチングすることができますが、トランザクションは複数の異なるドメインを使用することはできません。
どのDEXでも利用可能な流動性の量と最良の交換レートは、そのDEXに配置されたオファーによって異なる場合があります。一部のトレーダーは、価格差を利用するために複数の許可型DEXとオープンDEXで取引することを選択するかもしれませんが、他のトレーダーは、そのコンプライアンス要件に応じて、1つのドメインで厳密に取引するかもしれません。
{% inline-svg file="./permissioned-dex-structure.svg" /%}
_図: オープンDEXと2つの異なる許可型DEX。それぞれが、可能な通貨ペアのサブセットの注文帳を含んでいます。_
### 無効な許可型オファー
オープンDEXでオファーが資金不足になる方法に加えて、許可型DEXでのオファーは _無効_ になる可能性があります。無効なオファーは、資金不足のオファーと同じ方法で処理され、トランザクションがそれらを含むオーダーブックを変更するたびに自動的に削除されます。トランザクションがそれらを削除するまで、レジャーデータ内に無期限に残ることができますが、無効な場合は約定できません。
許可型オファーが無効になる理由には、以下のようなものがあります。
- オファーを置いたアカウントが保有する資格情報が期限切れまたは削除された。
- 許可型ドメインが更新され、アクセスを許可する資格情報のセットが変更され、オファーを置いたアカウントが新しい資格情報を保有していない。
- 許可型ドメインが削除された。
資金不足のオファーと同様に、オファーが一時的に無効になり、再度有効になる可能性があります。例えば、トレーダーの資格情報が許可型ドメインへのアクセスを許可する資格情報が期限切れになった場合、そのトレーダーの許可型DEXでのオファーは無効になります。しかし、資格情報が更新された場合、すでに削除されていないオファーは自動的に有効になります。
### 許可型DEXの制限
許可型DEX機能は、**PermissionedDEX** Amendmentによって有効になり、[Credentials](../../decentralized-storage/credentials.md)と[Permissioned Domains](./permissioned-domains.md) Amendmentに依存しているため、それらのAmendmentが _すべて_ 有効になるまで利用できません。
#### AMMとの互換性なし
許可型DEXは、[自動マーケットメーカー(AMM)](../../tokens/decentralized-exchange/automated-market-makers.md)と互換性がありません。許可型オファーと許可型支払いはAMMで約定できません。また、許可型ドメインによってAMMへのアクセスを制限することはできません。オープンDEXを使用する取引は、場合によってはハイブリッドオファーを消費し、同じトランザクションでAMMを使用することができますが、ドメインを指定するトランザクションではAMMを使用することはできません。
**許可型DEXは独立しています**
許可型DEXは独立しており、それぞれが独自のオーダーブックとオファーを持っています。1つのトランザクションは、複数の許可型DEXで取引することはできません。また、複数の許可型DEXから流動性を集約することはできません。ハイブリッドオファーは、1つの許可型DEXとオープンDEXの両方を使用することができますが、複数の異なる許可型DEXを使用することはできません。
#### 許可型DEXのセキュリティに関する考慮事項
許可型DEXのセキュリティと公平性は、許可型ドメインの所有者と、そのドメインへのアクセスを許可する資格情報の発行者に依存します。基本的に、各資格情報の定義とその資格情報を取得するための要件は、資格情報の発行者によって定義され、適用されているため、許可型ドメインの存在は、実際に誰がそれを使用できるかについて、本質的に何も意味しません。
資格情報の発行者は、資格情報を発行または取り消すことができます。もし、それらが信頼できないか、侵害されている場合、それらの資格情報を受け入れる許可型ドメインも同様です。同様に、ドメインの所有者は、ドメインの承認された資格情報のリストを変更して、ドメインへのアクセスを許可または拒否することができるため、もし、それらが信頼できないか、侵害されている場合、ドメインも同様です。

View File

@@ -36,4 +36,4 @@ _([PermissionedDomains amendment][]が必要です {% not-enabled /%})_
- 単一資産Vaultと貸付プロトコル
- 許可型DEX
{% raw-partial file="/docs/_snippets/common-links.md" /%}
{% raw-partial file="/@l10n/ja/docs/_snippets/common-links.md" /%}

View File

@@ -1,5 +1,6 @@
---
blurb: ディープフリーズは、トラストラインのフリーズが解除されるまで、フリーズされたトークン保有者がその資金を送受信できないようにします。
seo:
description: ディープフリーズは、トラストラインのフリーズが解除されるまで、フリーズされたトークン保有者がその資金を送受信できないようにします。
labels:
- トークン
- フリーズ

View File

@@ -1,5 +1,6 @@
---
blurb: Multi-Purpose Tokenは、トラストラインよりもコンパクトで柔軟なトークンタイプです。
seo:
description: Multi-Purpose Tokenは、トラストラインよりもコンパクトで柔軟なトークンタイプです。
labels:
- トークン
- MPT

View File

@@ -313,9 +313,6 @@ _**公開ハブを使用してバリデータをネットワークに接続す
4. 記入したGoogleフォームを送信すると、ドメイン検証の成否を通知するメールがXRP Chartsから送信されます。ドメイン検証が成功した場合は、XRP Chartsの[バリデータレジストリー](https://xrpcharts.ripple.com/#/validators)にバリデータとドメインが表示されます。
<!--{ ***TODO: For the future - add a new section or separate document: "Operating a Trusted Validator" -- things that you need to be aware of once your validator has been added to a UNL and is participating in consensus. We should tell the user what to expect once they are listed in a UNL. How to tell if your validator is participating in the consensus process? How to tell if something isn't right with your validator - warning signs that they should look out for? How to tell if your validator has fallen out of agreement - what is the acceptable vs unacceptable threshold? Maybe provide a script that will alert them when something is going wrong.*** }-->
## バリデータキーの破棄

View File

@@ -81,7 +81,7 @@ rippled -- account_tx rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w -1 -1 2 0 binary descen
| `marker` | [マーカー][] | 以前にページネーションされたレスポンスの値。そのレスポンスを停止した箇所からデータの取得を再開します。サーバが使用できるレジャーの範囲に変更があっても、この値は変わりません。 |
- リクエスト内で次の各フィールドのうち1つ以上を使用する必要があります: `ledger_index``ledger_hash``ledger_index_min`、または`ledger_index_max`
- [API v2] `ledger_index``ledger_hash`のどちらかを指定した場合、`ledger_index_min``ledger_index_max`を含めると`invalidParams`エラーが返ります。
- [API v2][] `ledger_index``ledger_hash`のどちらかを指定した場合、`ledger_index_min``ledger_index_max`を含めると`invalidParams`エラーが返ります。
### 照会されたデータの繰り返し

View File

@@ -119,7 +119,7 @@ rippled json ledger_entry '{ "index": "7DB0788C020F02780A673DC74757F23823FA3014C
アドレスから[AccountRootエントリ](../../../protocol/ledger-data/ledger-entry-types/accountroot.md)を取得します。これは[account_infoメソッド][]とほぼ同じです。
| フィールド | 型 | 説明 |
|:----------- ---|:--------------------|:----------------------|
|:---------------|:--------------------|:----------------------|
| `account_root` | 文字列 - [アドレス][] | 取得する[AccountRootエントリ](../../../protocol/ledger-data/ledger-entry-types/accountroot.md)の標準アドレス。 |
{% tabs %}

View File

@@ -1,6 +1,4 @@
---
html: book_offers.html
parent: path-and-order-book-methods.html
seo:
description: オーダーブックと呼ばれる、2つの通貨間のオファーのリストを取得します。
labels:
@@ -10,7 +8,7 @@ labels:
# book_offers
[[ソース]](https://github.com/XRPLF/rippled/blob/master/src/ripple/rpc/handlers/BookOffers.cpp "Source")
`book_offers`メソッドは、[オーダーブック](http://www.investopedia.com/terms/o/order-book.asp)と呼ばれる、2つの通貨間のオファーのリストを取得します。結果が非常に大きい場合、結果の一部がマーカー付きで返されます。これにより、その後のリクエストは前回のリクエストで終わった箇所から再開できます。
`book_offers`メソッドは、2つの通貨間の[オファー](../../../../concepts/tokens/decentralized-exchange/offers.md)のリストを取得します。これは、_オーダーブック_ とも呼ばれます。レスポンスは、[資金供給のないオファー](../../../../concepts/tokens/decentralized-exchange/offers.md#オファーのライフサイクル)を省略し、残りの各オファーの合計に対して資金供給されている割合を報告します。
## リクエストのフォーマット
リクエストのフォーマットの例:
@@ -69,15 +67,16 @@ rippled book_offers 'USD/rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B' 'EUR/rvYAfWj5gh67oV6
リクエストには以下のパラメーターが含まれます。
| `Field` | 型 | 説明 |
|:---------------|:-------------------------------------------|:-------------------------------|
| `ledger_hash` | 文字列 | _省略可_ 使用するレジャーバージョンの20バイトの16進文字列。[レジャーの指定][]をご覧ください) |
| `ledger_index` | 文字列または符号なし整数 | _省略可_ 使用するレジャーの[レジャーインデックス][]、またはレジャーを自動的に選択するためのショートカット文字列。([レジャーの指定][]をご覧ください) |
| `limit` | 符号なし整数 | _省略可_ 指定されている場合、サーバはこの制限を超える数のオファーを結果に含めません。資金供給のないオファーはサーバにより省略されるため、返される結果の総数はこの制限よりも少ないことがあります。 |
| `marker` | [マーカー][] | _省略可_ 以前にページネーションされたレスポンスの値。そのレスポンスを停止した箇所からデータの取得を再開します。 |
| `taker` | 文字列 | _省略可_ パースペクティブとして使用するアカウントの[アドレス][]。このアカウントが発行した[資金供給のないオファー](../../../../concepts/tokens/decentralized-exchange/offers.md#オファーのライフサイクル)は常にレスポンスに含まれます。(これを使用して、キャンセルしたい各自のオーダーを検索できます。 |
| `taker_gets` | オブジェクト | オファーを受諾するアカウントが受け取る通貨を、[通貨額][通貨額]と同様に、`currency`フィールドと`issuer`フィールドを持つオブジェクトとして指定しますXRPの場合はissuerを省略。 |
| `taker_pays` | オブジェクト | オファーを受諾するアカウントが支払う通貨を、[通貨額][通貨額]と同様に、`currency`フィールドと`issuer`フィールドを持つオブジェクトとして指定しますXRPの場合はissuerを省略 |
| フィールド | 型 | 必須? | 説明 |
|:---------------|:-------------------------|:-------|:-------------------------------|
| `taker_gets` | オブジェクト | はい | オファーを受諾するアカウントが受け取る通貨を、[通貨額][通貨額]と同様に、`currency`フィールドと`issuer`フィールドを持つオブジェクトとして指定しますXRPの場合はissuerを省略 |
| `taker_pays` | オブジェクト | はい | オファーを受諾するアカウントが支払う通貨を、[通貨額][通貨額]と同様に、`currency`フィールドと`issuer`フィールドを持つオブジェクトとして指定しますXRPの場合はissuerを省略 |
| `domain` | [ハッシュ][] | いいえ | 許可型ドメインのレジャーエントリID。指定された場合、オープンDEXの代わりに、対応する[許可型DEX](../../../../concepts/tokens/decentralized-exchange/permissioned-dexes.md)からオファーを返します。 _([PermissionedDEX amendment][]が必要です。 {% not-enabled /%})_ |
| `ledger_hash` | [ハッシュ][] | いいえ | 使用するレジャーバージョンの20バイトの16進文字列。[レジャーの指定][]をご覧ください) |
| `ledger_index` | [レジャーインデックス][] | いいえ | 使用するレジャーの[レジャーインデックス][]、またはレジャーを自動的に選択するためのショートカット文字列。([レジャーの指定][]をご覧ください |
| `limit` | 整数 | いいえ | 指定されている場合、サーバはこの制限を超える数のオファーを結果に含めません。資金供給のないオファーはサーバにより省略されるため、返される結果の総数はこの制限よりも少ないことがあります。 |
| `taker` | 文字列 | いいえ | パースペクティブとして使用するアカウントの[アドレス][]。このアカウントが発行した[資金供給のないオファー](../../../../concepts/tokens/decentralized-exchange/offers.md#オファーのライフサイクル)は常にレスポンスに含まれます。(これを使用して、キャンセルしたい各自のオーダーを検索できます。) |
## レスポンスのフォーマット
@@ -161,26 +160,97 @@ rippled book_offers 'USD/rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B' 'EUR/rvYAfWj5gh67oV6
```
{% /tab %}
{% tab label="Commandline" %}
```json
{
"result" : {
"ledger_current_index" : 56867201,
"offers" : [
{
"Account" : "rnixnrMHHvR7ejMpJMRCWkaNrq3qREwMDu",
"BookDirectory" : "7E5F614417C2D0A7CEFEB73C4AA773ED5B078DE2B5771F6D56038D7EA4C68000",
"BookNode" : "0000000000000000",
"Flags" : 131072,
"LedgerEntryType" : "Offer",
"OwnerNode" : "0000000000000000",
"PreviousTxnID" : "E43ADD1BD4AC2049E0D9DE6BC279B7FD95A99C8DE2C4694A4A7623F6D9AAAE29",
"PreviousTxnLgrSeq" : 47926685,
"Sequence" : 219,
"TakerGets" : {
"currency" : "EUR",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value" : "2.459108753792364"
},
"TakerPays" : {
"currency" : "USD",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value" : "24.59108753792364"
},
"index" : "3087B4828C6B5D8595EA325D69C0F396C57452893647799493A38F2C164990AB",
"owner_funds" : "2.872409153061363",
"quality" : "10"
},
{
"Account" : "rKwjWCKBaASEvtHCxtvReNd2i9n8DxSihk",
"BookDirectory" : "7E5F614417C2D0A7CEFEB73C4AA773ED5B078DE2B5771F6D56038D7EA4C68000",
"BookNode" : "0000000000000000",
"Flags" : 131072,
"LedgerEntryType" : "Offer",
"OwnerNode" : "0000000000000000",
"PreviousTxnID" : "B63B2ECD124FE6B02BC2998929517266BD221A02FEE51DDE4992C1BCB7E86CD3",
"PreviousTxnLgrSeq" : 43166305,
"Sequence" : 19,
"TakerGets" : {
"currency" : "EUR",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value" : "3.52"
},
"TakerPays" : {
"currency" : "USD",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value" : "35.2"
},
"index" : "89865F2C70D1140796D9D249AC2ED765AE2D007A52DEC6D6D64CCB1A77A6EB7F",
"owner_funds" : "3.523192614770459",
"quality" : "10",
"taker_gets_funded" : {
"currency" : "EUR",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value" : "3.516160294182094"
},
"taker_pays_funded" : {
"currency" : "USD",
"issuer" : "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value" : "35.16160294182094"
}
}
],
"status" : "success",
"validated" : false
}
}
```
{% /tab %}
{% /tabs %}
このレスポンスは[標準フォーマット][]に従っており、正常に完了した場合は結果に次のフィールドが含まれます。
| `Field` | 型 | 説明 |
|:-----------------------|:--------------------------|:------------------------|
| `ledger_current_index` | 数値 - [レジャーインデックス][] | _`ledger_current_index`が指定されている場合は省略_ この情報の取得時に使用した、現在処理中のレジャーバージョンの[レジャーインデックス][]。 |
| `ledger_index` | 数値 - [レジャーインデックス][] | _`ledger_current_index`が指定されている場合は省略可)_ リクエストに従って、このデータの取得時に使用されたレジャーバージョンのレジャーインデックス。 |
| `ledger_hash` | 文字列 - [ハッシュ][] | _省略される場合があります_ リクエストに従って、このデータの取得時に使用されたレジャーバージョンの識別用ハッシュ。 |
| `marker` | [マーカー][] | _省略される場合があります_ レスポンスがページネーションされていることを示す、サーバが定義した値。この値を次のコールに渡して、このコールで終わった箇所から再開します。この後に情報ページがない場合は省略されます。 |
| `offers` | 配列 | Offerオブジェクトの配列。各オブジェクトには[Offer オブジェクト](../../../protocol/ledger-data/ledger-entry-types/offer.md)のフィールドが含まれています。 |
| フィールド | 型 | 説明 |
|:-----------------------|:-------------------------|:------------------------|
| `ledger_current_index` | [レジャーインデックス][] | _(`ledger_current_index`が指定されている場合は省略)_ この情報の取得時に使用した、現在処理中のレジャーバージョンの[レジャーインデックス][]。 |
| `ledger_index` | [レジャーインデックス][] | _(`ledger_current_index`が指定されている場合は省略)_ リクエストに従って、このデータの取得時に使用されたレジャーバージョンのレジャーインデックス。 |
| `ledger_hash` | [ハッシュ][] | _省略される場合があります_ リクエストに従って、このデータの取得時に使用されたレジャーバージョンの識別用ハッシュ。 |
| `offers` | 配列 | Offerオブジェクトの配列。詳細は下記にて。 |
`offers`配列の要素には、Offerの標準フィールドの他に以下のフィールドが含まれます。
`offers`配列の要素には、[Offerエントリ][]の標準フィールドの他に以下の追加フィールドが含まれます。
| `Field` | 型 | 説明 |
|:--------------------|:---------------------------------|:--------------------|
| `owner_funds` | 文字列 | オファーの発行元が保有する取引可能なTakerGets通貨の金額。XRPはdrop単位で表されます。その他のすべての通貨は10進数値として表されます。1人のトレーダーの複数のオファーが同一のブックに含まれている場合、このフィールドは最高順位のオファーにのみ含まれます。 |
| `taker_gets_funded` | 文字列XRPまたはオブジェクトXRP以外 | 部分的に資金供給されているオファーのみに含まれますオファーの資金供給ステータスが指定されている場合に、受取人が受領できる最大通貨額。 |
| `taker_pays_funded` | 文字列XRPまたはオブジェクトXRP以外 | 部分的に資金供給されているオファーのみに含まれますオファーの資金供給ステータスが指定されている場合に、受取人が支払う最大通貨額。 |
| `quality` | 文字列 | 為替レート`taker_pays``taker_gets`で割った比率。公正を期すため、同じクオリティのオファーは先入れ先出しで自動的に受諾されます。つまり、複数の人々が通貨を同じレートで取引するオファーを出した場合、最も古いオファーが最初に受諾されます。 |
| フィールド | 型 | 説明 |
|:--------------------|:-----------|:--------------------|
| `owner_funds` | 文字列 | オファーの発行元が保有する取引可能なTakerGets通貨の金額。(XRPはdrop単位で表されます。その他のすべての通貨は10進数値として表されます。)1人のトレーダーの複数のオファーが同一のブックに含まれている場合、このフィールドは最高順位のオファーにのみ含まれます。 |
| `taker_gets_funded` | [通貨額][] | (部分的に資金供給されているオファーのみに含まれます) オファーの資金供給ステータスが指定されている場合に、受取人が受領できる最大通貨額。 |
| `taker_pays_funded` | [通貨額][] | (部分的に資金供給されているオファーのみに含まれます) オファーの資金供給ステータスが指定されている場合に、受取人が支払う最大通貨額。 |
| `quality` | 文字列 | 為替レート(`taker_pays``taker_gets`で割った比率)。公正を期すため、同じクオリティのオファーは先入れ先出しで自動的に約定されます。(つまり、複数の人々が通貨を同じレートで取引するオファーを出した場合、最も古いオファーが最初に受諾されます。) |
## 考えられるエラー

View File

@@ -1,7 +1,6 @@
---
html: get_aggregate_price.html
parent: ledger-methods.html
blurb: 指定されたOracleインスタンスの集計価格を計算します。
seo:
description: 指定されたOracleインスタンスの集計価格を計算します。
labels:
- オラクル
---

View File

@@ -1,5 +1,6 @@
---
blurb: 指定された`MPTokenIssuanceID`とledgerシーケンスに対する所有者の情報を取得します。
seo:
description: 指定された`MPTokenIssuanceID`とledgerシーケンスに対する所有者の情報を取得します。
labels:
- アカウント
- XRP

View File

@@ -55,14 +55,15 @@ path_findコマンドには3種類のモードサブコマンドがあり
リクエストには以下のパラメーターが含まれます。
| `Field` | 型 | 説明 |
|:----------------------|:-----------------|:----------------------------------|
| `subcommand` | 文字列 | `"create"`を使用してcreateサブコマンドを送信します。 |
| `source_account` | 文字列 | 索するパスの送金元アカウントの一意のアドレス。(つまり、支払いを送金するアカウントです。 |
| `destination_account` | 文字列 | 索するパスの送金先アカウントの一意のアドレス。(つまり、支払いを受領するアカウントです。 |
| `destination_amount` | 文字列またはオブジェクト | 送金先アカウントがトランザクションで受領する[通貨額][]。**特殊ケース:**{% badge href="https://github.com/XRPLF/rippled/releases/tag/0.30.0" %}新規: rippled 0.30.0{% /badge %}`value`フィールドには`"-1"`XRPの場合または-1XRP以外の通貨の場合を指定できます。これにより、最大限の額を送金できるパスがリクエストされます。ただし`send_max`指定されている場合は、指定額を上回る額が支払われることはありません。 |
| `send_max` | 文字列またはオブジェクト | _省略可_ トランザクションに使用する[通貨額][]。`source_currencies`と同時に指定することはできません。{% badge href="https://github.com/XRPLF/rippled/releases/tag/0.30.0" %}新規: rippled 0.30.0{% /badge %} |
| `paths` | 配列 | _省略可_ チェックする[ペイメントパス](../../../../concepts/tokens/fungible-tokens/paths.md)を表すオブジェクトの配列。すでに判明している特定パスの変更内容を常に把握する場合や、特定パスに沿った支払いにかかる総コストを確認する場合にこのフィールドを使用できます。 |
| フィールド | 型 | 必須? | 説明 |
|:----------------------|:-------------------------|:-------|:---------------------------|
| `subcommand` | 文字列 | はい | `"create"`を使用してcreateサブコマンドを送信します。 |
| `source_account` | 文字列 - [アドレス][] | はい | 索するパスの送金元アカウントのドレス。(つまり、支払いを送金するアカウント) |
| `destination_account` | 文字列 - [アドレス][] | はい | 索するパスの送金先アカウントのアドレス。(つまり、支払いを受領するアカウント) |
| `destination_amount` | [通貨額][] | はい | 送金先アカウントが受け取る金額。 **特殊ケース:** XRPの場合、`"-1"`を指定するか、トークンの場合、`value`フィールドの内容として-1を指定できます。これにより、`send_max`指定された金額を超えない範囲で、可能な限り多くの送金先への送金を要求します。 |
| `domain` | 文字列 - [ハッシュ][] | いいえ | 許可型ドメインのレジャーエントリID。指定された場合、対応する[許可型DEX](../../../../concepts/tokens/decentralized-exchange/permissioned-dexes.md)のみを使用するパスを返します。 _([PermissionedDEX amendment][]が必要です。 {% not-enabled /%})_ |
| `paths` | 配列 | いいえ | チェックする[支払いパス](../../../../concepts/tokens/fungible-tokens/paths.md)を表すオブジェクトの配列。すでに判明している特定パスの変更内容を常に把握する場合や、特定パスに沿った支払いにかかる総コストを確認する場合にこのフィールドを使用できます。 |
| `send_max` | [通貨額][] | いいえ | トランザクションに使用する[通貨額][]。`source_currencies`と同時に指定することはできません。|
サーバは`source_currencies`および`bridges`フィールドも認識しますが、これらのフィールドを使用した場合の結果は保証されません。これらのフィールドは将来のために予約されているものと考えてください。
@@ -444,8 +445,8 @@ path_findコマンドには3種類のモードサブコマンドがあり
この初期レスポンスは[標準フォーマット](../../api-conventions/response-formatting.md)に従っており、正常に完了した場合は次のフィールドが含まれています。
| `Field` | 型 | 説明 |
|:----------------------|:-----------------|:----------------------------------|
| フィールド | 型 | 説明 |
|:----------------------|:-----------------|:---------------------------|
| `alternatives` | 配列 | 以下に説明する、提案される[パス](../../../../concepts/tokens/fungible-tokens/paths.md)のオブジェクトの配列。空の場合、送金元アカウントと送金先アカウントを結ぶパスが見つかりませんでした。 |
| `destination_account` | 文字列 | トランザクションを受信するアカウントの一意のアドレス。 |
| `destination_amount` | 文字列またはオブジェクト | 送金先がトランザクションで受領する[通貨額][]。 |
@@ -455,8 +456,8 @@ path_findコマンドには3種類のモードサブコマンドがあり
`alternatives`配列の各要素は、1つの送金元通貨開始アカウントが保有から送金先アカウントへのパスと通貨を表すオブジェクトです。このオブジェクトのフィールドを次に示します。
| `Field` | 型 | 説明 |
|:-----------------|:-----------------|:---------------------------------------|
| フィールド | 型 | 説明 |
|:-----------------|:-----------------|:--------------------------------|
| `paths_computed` | 配列 | [ペイメントパス](../../../../concepts/tokens/fungible-tokens/paths.md)を定義するオブジェクトの配列。 |
| `source_amount` | 文字列またはオブジェクト | 送金先が必要な額を受領するために、送金元がこのパスで送金する必要がある[通貨額][]。 |
@@ -521,17 +522,17 @@ path_find createリクエストからの非同期フォローアップの例を
リクエストには以下のパラメーターが含まれます。
| `Field` | 型 | 説明 |
|:-------------|:-------|:-------------------------------------------|
| フィールド | 型 | 説明 |
|:-------------|:-------|:------------------------------------|
| `subcommand` | 文字列 | closeサブコマンドを送信するため`"close"`を使用します。 |
### レスポンスのフォーマット
Pathfindingリクエストが正常にクローズされた場合、レスポンスは[`path_find create`](#path_find-create)に対する初期レスポンスと同じフォーマットであり、されに以下のフィールドが含まれます。
| `Field` | 型 | 説明 |
|:---------|:--------|:--------------------------------------------------------|
| `closed` | ブール値 | 値が`true`の場合、これは`path_find close`コマンドに対するレスポンスです。 |
| フィールド | 型 | 説明 |
|:-----------|:--------|:-------------------------------------------------|
| `closed` | ブール値 | 値が`true`の場合、これは`path_find close`コマンドに対するレスポンスです。 |
未処理のPathfindingリクエストがない場合はエラーが返されます。
@@ -566,17 +567,17 @@ Pathfindingリクエストが正常にクローズされた場合、レスポン
リクエストには以下のパラメーターが含まれます。
| `Field` | 型 | 説明 |
|:-------------|:-------|:---------------------------------------------|
| フィールド | 型 | 説明 |
|:-------------|:-------|:--------------------------------------|
| `subcommand` | 文字列 | `"status"`を使用して、statusサブコマンドを送信します。 |
### レスポンスのフォーマット
Pathfindingリクエストが実行中の場合、レスポンスは[`path_find create`](#path_find-create)に対する初期レスポンスと同じフォーマットであるのに加えて、以下のフィールドがあります。
| `Field` | 型 | 説明 |
|:---------|:--------|:--------------------------------------------------------|
| `status` | ブール値 | 値が`true`の場合、これは`path_find status`コマンドに対するレスポンスです。 |
| フィールド | 型 | 説明 |
|:-----------|:--------|:-------------------------------------------------|
| `status` | ブール値 | 値が`true`の場合、これは`path_find status`コマンドに対するレスポンスです。 |
未処理のPathfindingリクエストがない場合はエラーが返されます。

View File

@@ -85,15 +85,16 @@ rippled ripple_path_find '{"source_account":"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"
リクエストには以下のパラメーターが含まれます。
| `Field` | 型 | 説明 |
|:----------------------|:---------------------------|:------------------------|
| `source_account` | 文字列 | トランザクションで資金を送金するアカウントの一意のアドレス。 |
| `destination_account` | 文字列 | トランザクションで資金を受領するアカウントの一意のアドレス。 |
| `destination_amount` | 文字列またはオブジェクト | 送金先アカウントがトランザクションで受領する[通貨額][]。**特殊なケース:** {% badge href="https://github.com/XRPLF/rippled/releases/tag/0.30.0" %}新規: rippled 0.30.0{% /badge %}`value`フィールドには`"-1"`XRPの場合または-1XRP以外の通貨の場合を指定できます。これにより、最大限の額を送金できるパスがリクエストされます。ただし`send_max`が指定されている場合は、指定されている額を上回る額が支払われることはありません。 |
| `send_max` | 文字列またはオブジェクト | _省略可_ トランザクションで使用する[通貨額][]。`source_currencies`と同時に使用することはできません。{% badge href="https://github.com/XRPLF/rippled/releases/tag/0.30.0" %}新規: rippled 0.30.0{% /badge %} |
| `source_currencies` | 配列 | _省略可_ 送信元アカウントが使用する通貨の配列。この配列の各エントリは、必須の`currency`フィールドとオプションの`issuer`フィールドを有するJSONオブジェクトです[通貨額][]の指定方法と同様)。指定できる送金元通貨は**18**種類以下です。デフォルトでは、あらゆる送金元通貨を使用し、最大で**88**の異なる通貨/イシュアーペアに使用できます。 |
| `ledger_hash` | 文字列 | _省略可_ 使用するレジャーバージョンの20バイトの16進文字列。([レジャーの指定][]をご覧ください) |
| `ledger_index` | 文字列または符号なし整数 | _省略可_ 使用するレジャーのシーケンス番号、またはレジャーを自動的に選択するためのショートカット文字列。([レジャーの指定][]をご覧ください) |
| フィールド | 型 | 必須? | 説明 |
|:----------------------|:-------------------------|:-------|:-----------------|
| `source_account` | 文字列 - [アドレス][] | はい | トランザクションで資金を送金するアカウントのアドレス。 |
| `destination_account` | 文字列 - [アドレス][] | はい | トランザクションで資金を受領するアカウントのアドレス。 |
| `destination_amount` | [通貨額][] | はい | 送金先アカウントがトランザクションで受領する[通貨額][]。**特殊なケース:** `value`フィールドには`"-1"`XRPの場合または-1XRP以外の通貨の場合を指定できます。これにより、最大限の額を送金できるパスがリクエストされます。ただし`send_max`が指定されている場合は、指定されている額を上回る額が支払われることはありません。 |
| `domain` | 文字列 - [ハッシュ][] | いいえ | 許可型DEXのレジャーエントリID。指定された場合、対応する[許可型DEX](../../../../concepts/tokens/decentralized-exchange/permissioned-dexes.md)のみを使用するパスを返します。([PermissionedDEX amendment][] {% not-enabled /%}が必要です) |
| `ledger_hash` | 文字列 - [ハッシュ][] | いいえ | 使用するレジャーバージョンの20バイトの16進文字列。[レジャーの指定][]をご覧ください) |
| `ledger_index` | [レジャーインデックス][] | いいえ | 使用するレジャーのシーケンス番号、またはレジャーを自動的に選択するためのショートカット文字列。([レジャーの指定][]をご覧ください) |
| `send_max` | [通貨額][] | いいえ | トランザクションで使用する[通貨額][]。`source_currencies`と同時に使用することはできません。 |
| `source_currencies` | 配列 | いいえ | 送信元アカウントが使用する通貨の配列。この配列の各エントリは、必須の`currency`フィールドとオプションの`issuer`フィールドを有するJSONオブジェクトです[通貨額][]の指定方法と同様)。指定できる送金元通貨は**18**種類以下です。デフォルトでは、あらゆる送金元通貨を使用し、最大で**88**の異なる通貨/イシュアーペアに使用できます。 |
## レスポンスのフォーマット
@@ -323,7 +324,7 @@ rippled ripple_path_find '{"source_account":"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"
このレスポンスは[標準フォーマット][]に従っており、正常に完了した場合は結果に次のフィールドが含まれます。
| `Field` | 型 | 説明 |
| フィールド | 型 | 説明 |
|:-------------------------|:-------|:-----------------------------------------|
| `alternatives` | 配列 | 使用可能なパスを持つオブジェクトの配列。以下に説明します。空の場合、送金元アカウントと送金先アカウントを結ぶパスがありません。 |
| `destination_account` | 文字列 | 支払トランザクションを受信するアカウントの一意のアドレス。 |
@@ -331,7 +332,7 @@ rippled ripple_path_find '{"source_account":"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"
`alternatives`配列の各要素は、1つの送金元通貨開始アカウントが保有から送金先アカウントへのパスと通貨を表すオブジェクトです。このオブジェクトのフィールドを次に示します。
| `Field` | 型 | 説明 |
| フィールド | 型 | 説明 |
|:-----------------|:-----------------|:---------------------------------------|
| `paths_computed` | 配列 | (省略可)[ペイメントパス](../../../../concepts/tokens/fungible-tokens/paths.md)を定義するオブジェクトの配列。 |
| `source_amount` | 文字列またはオブジェクト | 送金先が希望額を受領できるよう、送金元がこのパスで送金する必要のある[通貨額][]。 |

View File

@@ -10,7 +10,7 @@ labels:
- スマートコントラクト
---
# subscribe
[[ソース]](https://github.com/XRPLF/rippled/blob/master/src/ripple/rpc/handlers/Subscribe.cpp "Source")
[[ソース]](https://github.com/XRPLF/rippled/blob/master/src/xrpld/rpc/handlers/Subscribe.cpp "Source")
`subscribe`メソッドは、特定のイベントが発生した場合に、定期的に通知するようサーバにリクエストします。
@@ -66,42 +66,47 @@ labels:
リクエストには以下のパラメーターが含まれます。
| `Field` | 型 | 説明 |
| :------------------ | :----- | ---- |
| `streams` | 配列 | _省略可_ 以下説明するサブスクライブする汎用ストリームの文字列名の配列。 |
| `accounts` | 配列 | _省略可_ 検証済みトランザクションを監視するアカウントの一意のアドレスを持つ配列。これらのアドレスはXRP Ledgerの[base58][]フォーマットで記述されている必要があります。サーバは、1つ以上のアカウントに影響するすべてのトランザクションについて通知を送信します。 |
| `accounts_proposed` | 配列 | _省略可_ `accounts`と同様ですが、まだファイナライズされていないトランザクションを含みます。 |
| `books` | 配列 | _省略可_ 以下に説明するとおり、更新監視のために[オーダーブック](http://www.investopedia.com/terms/o/order-book.asp)を定義するオブジェクトの配列。 |
| `url` | 文字列 | Websocketでは省略可、それ以外では必須サーバが各イベントのJSON-RPCコールバックを送信するURL。*管理者専用。* |
| `url_username` | 文字列 | _省略可_ コールバックURLで基本認証を行うためのユーザ名。 |
| `url_password` | 文字列 | _省略可_ コールバックURLで基本認証を行うためのパスワード。 |
| フィールド | 型 | 必須? | 説明 |
|:--------------------|:-------|:-------|:-----|
| `streams` | 配列 | いいえ | 以下説明するストリームにサブスクライブします。配列の各要素は、ストリームの文字列名でなければなりません。 |
| `accounts` | 配列 | いいえ | 検証済みトランザクションを監視するアカウントの一意の[アドレス][]を持つ配列。サーバは、少なくともこれらのアカウントのいずれかに影響を与えるトランザクションが発生するたびに、`transaction`タイプのメッセージを送信します。 |
| `accounts_proposed` | 配列 | いいえ | `accounts`と同様ですが、まだファイナライズされていないトランザクションを含みます。 |
| `books` | 配列 | いいえ | 更新監視するオーダーブック。配列の各要素は、以下で定義される[book object](#book-objects)でなければなりません。サーバは、トランザクションがこのアカウントに影響を与えるたびに、`transaction`タイプのメッセージを送信します。 |
| `url` | 文字列 | いいえ | Websocketでは省略可、それ以外では必須サーバが各イベントのJSON-RPCコールバックを送信するURL。*管理者専用。* |
| `url_username` | 文字列 | いいえ | コールバックURLで基本認証を行うためのユーザ名。 |
| `url_password` | 文字列 | いいえ | コールバックURLで基本認証を行うためのパスワード。 |
以下のパラメータは廃止予定で、今後予告なしに削除される可能性があります。`user``password``rt_accounts`
以下のパラメータは廃止予定で、今後予告なしに削除される可能性があります。`user``password``rt_accounts`
`streams`パラメータは、以下のデフォルトの情報ストリームへのアクセスを可能にします。
`streams`パラメータは、以下のデフォルトの情報ストリームへのアクセスを可能にします。
- `book_changes` - コンセンサスプロセスが新しい有効なレジャーを作成するたびに、オーダーブックの変更をメッセージで送信します。
- `consensus` - サーバがコンセンサスサイクルのフェーズを変更するたびにメッセージを送信します。
- `ledger` - コンセンサスプロセス新しい検証済みレジャー宣言されるたびにメッセージ送信します。
- `manifests` - バリデータのephemeral署名鍵の更新を受け取るたびにメッセージを送信します。
- `peer_status` - **(管理者専用)** 接続している`rippled`のピアサーバに関する情報(特にコンセンサスプロセスに関する情報)。
- `transactions` - 閉鎖済みレジャーにトランザクションが追加されるたびにメッセージを送信します。
- `transactions_proposed` - 閉鎖済みレジャーにトランザクションが追加される場合や、検証済みレジャーにまだ追加されておらず、今後も追加される見込みのない一部のトランザクションが検証済みレジャーに追加される場合に、メッセージを送信します。提案されたすべてのトランザクションが検証前に表示されるわけではありません。
{% admonition type="info" name="注記" %}[成功しなかったトランザクション](../../../protocol/transactions/transaction-results/index.md) 成功しなかったトランザクションも、スパム対策取引手数料を取るため、検証済みレジャーに含まれます。{% /admonition %}
- `server` - `rippled`サーバのステータス(ネットワーク接続など)が変更されるたびにメッセージを送信します。
- `validations` - サーバがバリデータを信頼しているか否かにかかわらず、サーバが検証メッセージを受信するたびに、メッセージを送信します。(個々の`rippled`は、サーバが少なくとも定数の信頼できるバリデータから検証メッセージを信した時点で、レジャーが検証済みであると宣言します。
| ストリーム名 | メッセージタイプ | 説明 |
|:------------------------|:---------------------|:------------|
| `book_changes` | `bookChanges` | コンセンサスプロセス新しい検証済みレジャー宣言るたびに、オーダーブックの変更をメッセージ送信します。 |
| `consensus` | `consensusPhase` | サーバがコンセンサスサイクルのフェーズを変更するたびにメッセージを送信します。 |
| `ledger` | `ledgerClosed` | コンセンサスプロセスで新しい検証済みレジャーが宣言されるたびにメッセージを送信します。 |
| `manifests` | `manifestReceived` | バリデータのephemeral署名鍵の更新を受け取るたびにメッセージを送信します。 |
| `peer_status` | `peerStatusChange` | **(管理者専用)** 接続している`rippled`のピアサーバに関する情報(特にコンセンサスプロセスに関する情報)。 |
| `transactions` | `transaction` | 閉鎖済みレジャーにトランザクションが追加されるたびにメッセージを送信します。 |
| `transactions_proposed` | `transaction` | 閉鎖済みレジャーにトランザクションが追加される場合や、検証済みレジャーにまだ追加されておらず、今後も追加される見込みのない一部のトランザクションが検証済みレジャーに追加される場合に、メッセージを送信します。提案されたすべてのトランザクションが検証前に表示されるわけではありません。 {% admonition type="info" name="注記" %}[成功しなかったトランザクション](../../../protocol/transactions/transaction-results/index.md) 成功しなかったトランザクションも、スパム対策取引手数料を取るため、検証済みレジャーに含まれます。{% /admonition %} |
| `server` | `serverStatus` | `rippled`サーバのステータス(ネットワーク接続など)が変更されるたびにメッセージを信します。 |
| `validations` | `validationReceived` | サーバがバリデータを信頼しているか否かにかかわらず、サーバが検証メッセージを受信するたびに、メッセージを送信します。(個々の`rippled`は、サーバが少なくとも定数の信頼できるバリデータから検証メッセージを受信した時点で、レジャーが検証済みであると宣言します。) |
{% admonition type="info" name="注記" %}以下のストリームは Clioおよび[レポートモード][]の`rippled`サーバからは利用できません: `server``peer_status``consensus`。これらのストリームを要求すると、どちらも`reportingUnsupported`エラーを返します。 {% badge href="https://github.com/XRPLF/rippled/releases/tag/1.8.1" %}更新: rippled 1.8.1{% /badge %} {% badge href="https://github.com/XRPLF/clio/releases/tag/2.0.0" %}新規: Clio v2.0{% /badge %}{% /admonition %}
### Bookオブジェクト
`books`配列が指定されている場合、この配列の各要素は、以下のフィールドを持つオブジェクトです。
| `Field` | 型 | 説明 |
| :----------- | :----------- | ---- |
| `taker_gets` | オブジェクト | オファーを受諾するアカウントが受け取る通貨を[金額なしの通貨オブジェクト](../../../protocol/data-types/currency-formats.md#金額なしでの通貨の指定)として指定します。 |
| `taker_pays` | オブジェクト | オファーを受諾するアカウントが支払う通貨を[金額なしの通貨オブジェクト](../../../protocol/data-types/currency-formats.md#金額なしでの通貨の指定)として指定します。 |
| `taker` | 文字列 | オファーを表示するパースペクティブとして使用する一意のアカウントアドレスXRP Ledgerの[base58][]フォーマット)。(これはオファーの資金提供ステータスと手数料に影響します。) |
| `snapshot` | ブール値 | (省略可)`true`の場合は、更新の送信前にサブスクライブした時点でオーダーブックの現在の状態を一度返します。デフォルトは`false` |
| `both` | ブール値 | (省略可)`true`の場合は、オーダーブックの両サイドを返します。デフォルトは`false` |
| フィールド | 型 | 必須? | 説明 |
| :----------- | :-------------------- | :----- | ---- |
| `taker_gets` | オブジェクト | はい | オファーを受諾するアカウントが受け取る通貨を[金額なしの通貨オブジェクト](../../../protocol/data-types/currency-formats.md#金額なしでの通貨の指定)として指定します。 |
| `taker_pays` | オブジェクト | はい | オファーを受諾するアカウントが支払う通貨を[金額なしの通貨オブジェクト](../../../protocol/data-types/currency-formats.md#金額なしでの通貨の指定)として指定します。 |
| `both` | ブール値 | いいえ | `true`の場合は、オーダーブックの両サイドを返します。デフォルトは`false` |
| `domain` | 文字列 - [ハッシュ][] | いいえ | 許可型DEXのレジャーエントリID。指定された場合、対応する[許可型DEX](../../../../concepts/tokens/decentralized-exchange/permissioned-dexes.md)のみを使用するパスを返します。([PermissionedDEX amendment][] {% not-enabled /%}が必要です) |
| `snapshot` | ブール値 | いいえ | `true`の場合は、更新の送信前にサブスクライブした時点でオーダーブックの現在の状態を一度返します。デフォルトは`false` |
| `taker` | 文字列 | いいえ | オファーを表示するパースペクティブとして使用する一意のアカウントアドレスXRP Ledgerの[base58][]フォーマット)。(これはオファーの資金提供ステータスと手数料に影響します。) |
## レスポンスのフォーマット
@@ -167,7 +172,7 @@ labels:
レジャーストリームメッセージのフィールドは次のとおりです。
| `Field` | 型 | 説明 |
| フィールド | 型 | 説明 |
| :------------------ | :------------------------------ | ---- |
| `type` | 文字列 | `ledgerClosed`は、このメッセージがレジャーストリームからのものであることを示します。 |
| `fee_base` | 数値 | このレジャーバージョン時点の[Referenceトランザクションコスト](../../../../concepts/transactions/transaction-cost.md#referenceトランザクションコスト)[XRPのdrop数][])。このレジャーバージョンに[SetFee疑似トランザクション](../../../protocol/transactions/pseudo-transaction-types/setfee.md)が含まれている場合は、次のレジャーバージョンから新しいトランザクションコストが適用されます。 |
@@ -212,7 +217,7 @@ labels:
検証ストリームメッセージのフィールドは次のとおりです。
| `Field` | 型 | 説明 |
| フィールド | 型 | 説明 |
| :---------------------- | :------------ | ---- |
| `type` | 文字列 | 値`validationReceived`は、このメッセージが検証ストリームからであることを示します。 |
| `amendments` | 文字列の配列 | (省略される場合があります)このサーバがプロトコルへの追加を求める[Amendment](../../../../concepts/networks-and-servers/amendments.md)。 |
@@ -333,7 +338,7 @@ labels:
{% tab label="API v2" %}
| `Field` | 型 | 説明 |
| フィールド | 型 | 説明 |
|:------------------------|:--------------------------|:-----|
| `close_time_iso` | 文字列 | レジャーの終了時刻をISO 8601の時刻形式で表します。 |
| `type` | 文字列 | `transaction`は、複数の可能なストリームからのトランザクションの通知であることを示します。 |
@@ -352,7 +357,7 @@ labels:
{% tab label="API v1" %}
| `Field` | 型 | 説明 |
| フィールド | 型 | 説明 |
| :---------------------- | :------------------------------ | ---- |
| `type` | 文字列 | `transaction`は、トランザクションの通知であることを示します。この通知はさまざまなストリームから送信される可能性があります。 |
| `engine_result` | 文字列 | 文字列の[トランザクション結果コード](../../../protocol/transactions/transaction-results/index.md) |
@@ -389,7 +394,7 @@ labels:
ピアステータスストリームメッセージは、`rippled`ピアサーバのステータスが変化したイベントを表します。これらのメッセージは、次のフィールドを持つJSONオブジェクトです。
| `Field` | 値 | 説明 |
| フィールド | 値 | 説明 |
| :----------------- | :----- | ---- |
| `type` | 文字列 | `peerStatusChange`は、ピアステータスストリームからのメッセージであることを示します。 |
| `action` | 文字列 | このメッセージが送信される原因となったイベントのタイプ。有効な値については、[ピアステータスイベント](#ピアステータスイベント)をご覧ください。 |
@@ -561,7 +566,7 @@ labels:
オーダーブックストリームメッセージの形式は、[トランザクションストリームメッセージ](#トランザクションストリーム)と同様ですが、`OfferCreate`トランザクションに以下のフィールドも含まれている点が異なります。
| `Field` | 値 | 説明 |
| フィールド | 値 | 説明 |
| :------------------------ | :----- | ---- |
| `transaction.owner_funds` | 文字列 | このOfferCreateトランザクションを送信する`Account`が、このトランザクション実行後に有する`TakerGets`通貨の金額。この通貨額が[フリーズ](../../../../concepts/tokens/fungible-tokens/freezes.md)されているかどうかはチェックされません。<br>[API v2][]では`tx_json.owner_funds`に変更されました。 |
@@ -695,7 +700,7 @@ labels:
[Book Changes]ストリームメッセージのフィールドは以下のとおりです:
| Field | 値 | 説明 |
| フィールド | 値 | 説明 |
|:---------------|:-------------------------|:-----|
| `type` | 文字列 | 値`bookChanges`は、これがBook Changesストリームからのものであることを示します。 |
| `ledger_index` | [レジャーインデックス][] | これらの変更を含むレジャーのレジャーインデックス。 |
@@ -717,7 +722,7 @@ labels:
コンセンサスストリームメッセージのフィールドは次のとおりです。
| `Field` | 型 | 説明 |
| フィールド | 型 | 説明 |
| :---------- | :----- | ---- |
| `type` | 文字列 | `consensusPhase`は、このメッセージがコンセンサスストリームからのものであることを示します。 |
| `consensus` | 文字列 | サーバで実行されている新しいコンセンサスフェーズ。値には、`open``establish``accepted`などがあります。 |

View File

@@ -73,7 +73,7 @@ XRPの金額は負になることはありません。
}
```
#### 金額なしでの通貨の指定
### 金額なしでの通貨の指定
場合によっては、[分散型取引所](../../../concepts/tokens/decentralized-exchange/index.md)でオーダーブックを指定するときなど、特定の金額なしで資産(XRPやトークン)を定義する必要があります。

View File

@@ -6,7 +6,7 @@ labels:
- 分散型取引所
---
# DirectoryNode
[[ソース]](https://github.com/XRPLF/rippled/blob/5d2d88209f1732a0f8d592012094e345cbe3e675/src/ripple/protocol/impl/LedgerFormats.cpp#L44 "Source")
[[ソース]](https://github.com/XRPLF/rippled/blob/7e24adbdd0b61fb50967c4c6d4b27cc6d81b33f3/include/xrpl/protocol/detail/ledger_entries.macro#L177-L192 "Source")
`DirectoryNode`オブジェクトタイプは、レジャーの状態ツリー内の他オブジェクトへのリンクのリストを提供します。概念上の1つの _ディレクトリ_ は、1つ以上の各DirectoryNodeオブジェクトが含まれる二重リンクリストの形式になっています。各DirectoryNodeオブジェクトには、他オブジェクトの[ID](../common-fields.md)が最大32個まで含まれています。1番目のオブジェクトはディレクトリのルートと呼ばれ、ルートオブジェクト以外のオブジェクトはすべて必要に応じて自由に追加または削除できます。
@@ -95,6 +95,7 @@ labels:
| 名前 | JSONの型 | [内部の型][] | 必須? | 説明 |
|---------------------|-----------|--------------|:-------|-------------|
| `DomainID` | 文字列 | Hash256 | いいえ | (オファーディレクトリのみ) 許可型DEXのレジャーエントリID。指定された場合、対応する[許可型DEX](../../../../concepts/tokens/decentralized-exchange/permissioned-dexes.md)のみを使用するパスを返します。([PermissionedDEX amendment][] {% not-enabled /%}が必要です。) |
| `ExchangeRate` | 数値 | UInt64 | いいえ | (オファーディレクトリのみ)**廃止予定**。使用しないでください。 |
| `Flags` | 数値 | UInt32 | はい | このディレクトリに対して有効になっているブール値フラグのビットマップ。現在、プロトコルではDirectoryNodeオブジェクトのフラグは定義されていません。 |
| `Indexes` | 配列 | Vector256 | はい | このディレクトリの内容: 他のオブジェクトのIDの配列。 |
@@ -135,6 +136,7 @@ DirectoryNodeのIDを作成するときには、DirectoryNodeが以下のどの
* 所有者ディレクトリまたはNFTオファーディレクトリの1番目のページルートとも呼ばれます
* オファーディレクトリの1番目のページ
* オファーディレクトリの最初のページ。オープンDEXと認可型DEX用のバージョンが含まれます。 _([PermissionedDEX amendment][]が必要です。 {% not-enabled /%})_
* いずれかのディレクトリの以降のページ
**所有者ディレクトリまたはNFTオファーディレクトリの1番目のページ**のIDは、以下の値がこの順序で連結されている[SHA-512Half][]です。
@@ -149,6 +151,7 @@ DirectoryNodeのIDを作成するときには、DirectoryNodeが以下のどの
* `TakerGetsCurrency`の160ビットの通貨コード
* `TakerPaysIssuer`のAccountID
* `TakerGetsIssuer`のAccountID
* このオーダーブックが属する許可型DEXの許可型ドメインの`DomainID`。許可型DEXのオーダーブックの場合。オープンDEXのオーダーブックの場合は省略。
オファーディレクトリのIDの下位64ビットは、そのディレクトリ内のオファーのTakerPaysの額をTakerGetsの額で割った結果を、XRP Ledgerの内部金額フォーマットの64ビット数値で表したものです。

View File

@@ -1,5 +1,6 @@
---
blurb: XRPLのMulti-Purpose Tokenのオブジェクトについて説明します。
seo:
description: XRPLのMulti-Purpose Tokenのオブジェクトについて説明します。
labels:
- Multi-Purpose Token, MPT, トークン
---

View File

@@ -1,5 +1,6 @@
---
blurb: Introduction to XRPL MPTs.
seo:
description: 単一のMPT Issuanceを表し、Issuance自体に関連するデータを保持します。
labels:
- Multi-Purpose Token, MPT, トークン
---

View File

@@ -7,9 +7,9 @@ labels:
- 分散型取引所
---
# Offer
[[ソース]](https://github.com/XRPLF/rippled/blob/5d2d88209f1732a0f8d592012094e345cbe3e675/src/ripple/protocol/impl/LedgerFormats.cpp#L57 "Source")
[[ソース]](https://github.com/XRPLF/rippled/blob/7e24adbdd0b61fb50967c4c6d4b27cc6d81b33f3/include/xrpl/protocol/detail/ledger_entries.macro#L242-L255 "ソース")
台帳の`Offer`エントリは、XRP Ledgerの[分散型取引所](../../../../concepts/tokens/decentralized-exchange/index.md)で通貨を交換する[オファー](../../../../concepts/tokens/decentralized-exchange/offers.md)を表しています。(金融ではより伝統的に _オーダー_ として知られています)。[OfferCreateトランザクション][]は台帳にある他のOfferを全額約定できない場合、台帳に`Offer`エントリを作成します。
`Offer`レジャーエントリは、XRP Ledgerの[分散型取引所](../../../../concepts/tokens/decentralized-exchange/index.md)で通貨を交換する[オファー](../../../../concepts/tokens/decentralized-exchange/offers.md)を表しています。(金融ではより伝統的に _オーダー_ として知られています)。[OfferCreateトランザクション][]は他のOfferを全額約定できない場合、Offerエントリを作成します。
オファーがネットワーク上の他の活動によって資金不足になることはありますが、元帳には残ります。トランザクションを処理する際、ネットワークはトランザクションが見つけた資金不足のオファーを自動的に削除します。( _トランザクションのみ_ が台帳の状態を変更できるため、削除が行われないと資金不足のオファーが残ってしまいます。)
@@ -40,29 +40,32 @@ labels:
[共通フィールド][]に加えて、{% $frontmatter.seo.title %}エントリは以下のフィールドを使用します。
| 名前 | JSONの型 | [内部の型][] | 必須? | 説明 |
|-------------------|-----------|-----------|------|-------|
| `Account` | 文字列 | AccountID | はい | このオファーを所有するアカウントのアドレス。 |
| `BookDirectory` | 文字列 | UInt256 | はい | このオファーにリンクしている[オファーディレクトリー](directorynode.md)のID。 |
| `BookNode` | 文字列 | UInt64 | はい | Offerディレクトリが複数ページで構成されている場合に、このオブジェクトにリンクしているページを示すヒント。 |
| `Expiration` | 数値 | UInt32 | いいえ | (省略可)このオファーが資金不足とみなされる時刻。詳細は、[時間の指定][]をご覧ください。 |
| `Flags` | 数値 | UInt32 | はい | このオファーに対して有効になっているブール値フラグのビットマップ。 |
| `LedgerEntryType` | 文字列 | UInt16 | はい | 値が`0x006F`(文字列`Offer`にマッピング)の場合は、このオブジェクトが通貨取引オーダーを記述することを示す。 |
| `OwnerNode` | 文字列 | UInt64 | はい | 所有者ディレクトリーが複数ページで構成されている場合に、このオブジェクトにリンクしているページを示すヒント。**注記:** このオファーには、オファーを含む所有者ディレクトリーへの直接リンクは含まれていません。これは、その値を`Account`から取得できるためです。 |
| `PreviousTxnID` | 文字列 | UInt256 | はい | 最後にこのオブジェクトを変更したトランザクションの識別用ハッシュ。 |
| `Sequence` | 数値 | UInt32 | はい | `Offer`オブジェクトを作成した[OfferCreate][]トランザクションの`Sequence`値。`Account`とこのフィールドの組み合わせによってこのオファーが識別されます。 |
| 名前 | JSONの型 | [内部の型][] | 必須? | 説明 |
|---------------------|-----------------------|--------------|-------|-------|
| `Account` | 文字列 | AccountID | はい | このオファーを所有するアカウントのアドレス。 |
| `AdditionalBooks` | 配列 | Array | いいえ| 追加のオファーディレクトリーのリスト。このフィールドは、このオファーが[許可型DEX](../../../../concepts/tokens/decentralized-exchange/permissioned-dexes.md)でハイブリッドオファーの場合にのみ存在します。配列には常に1つのエントリが含まれます。([PermissionedDEX amendment][] {% not-enabled /%}が必要です。) |
| `BookDirectory` | 文字列 - [ハッシュ][] | UInt256 | はい | このオファーにリンクしている[オファーディレクトリー](directorynode.md)のID。 |
| `BookNode` | 文字列 | UInt64 | はい | Offerディレクトリが複数ページで構成されている場合に、このオブジェクトにリンクしているページを示すヒント。 |
| `DomainID` | 文字列 - [ハッシュ][] | Hash256 | いいえ | 許可型DEXのレジャーエントリID。指定された場合、対応する[許可型DEX](../../../../concepts/tokens/decentralized-exchange/permissioned-dexes.md)のみを使用するパスを返します。([PermissionedDEX amendment][] {% not-enabled /%}が必要です。) |
| `Expiration` | 数値 | UInt32 | いいえ | (省略可)このオファーが資金不足とみなされる時刻。詳細は、[時間の指定][]をご覧ください。 |
| `Flags` | 数値 | UInt32 | はい | このオファーに対して有効になっているブール値フラグのビットマップ。 |
| `LedgerEntryType` | 文字列 | UInt16 | はい | 値が`0x006F`(文字列`Offer`にマッピング)の場合は、このオブジェクトが通貨取引オーダーを記述することを示す。 |
| `OwnerNode` | 文字列 | UInt64 | はい | 所有者ディレクトリーが複数ページで構成されている場合に、このオブジェクトにリンクしているページを示すヒント。**注記:** このオファーには、オファーを含む所有者ディレクトリーへの直接リンクは含まれていません。これは、その値を`Account`から取得できるためです。 |
| `PreviousTxnID` | 文字列 - [ハッシュ][] | UInt256 | はい | 最後にこのオブジェクトを変更したトランザクションの識別用ハッシュ。 |
| `Sequence` | 数値 | UInt32 | はい | `Offer`オブジェクトを作成した[OfferCreate][]トランザクションの`Sequence`値。`Account`とこのフィールドの組み合わせによってこのオファーが識別されます。 |
| `PreviousTxnLgrSeq` | 数値 | UInt32 | はい | 最後にこのオブジェクトを変更したトランザクションが記録された[レジャーインデックス][]。 |
| `TakerPays` | 文字列またはオブジェクト | Amount | はい | オファー作成者がリクエストする残額と通貨の種類。 |
| `TakerGets` | 文字列またはオブジェクト | Amount | はい | オファー作成者が提供する残額と通貨の種類。 |
| `TakerPays` | [通貨額][] | Amount | はい | オファー作成者がリクエストする残額と通貨の種類。 |
| `TakerGets` | [通貨額][] | Amount | はい | オファー作成者が提供する残額と通貨の種類。 |
## Offerのフラグ
`Offer`エントリは以下のフラグを`Flags`フィールドに指定することができます。
| フラグ名 | 16進数値 | 10進数値 | 対応する[OfferCreateフラグ](../../transactions/types/offercreate.md#offercreateフラグ) | 説明 |
|-----------|-----------|---------------|-------------|------------------------|
| `lsfPassive` | `0x00010000` | 65536 | `tfPassive` | オブジェクトはパッシブオファーとして発注されています。レジャー内のオブジェクトには影響しません。 |
| `lsfSell` | `0x00020000` | 131072 | `tfSell` | オブジェクトは売却オファーとして発注されています。これは台帳にあるオブジェクトには何の影響もありません (`tfSell`は指定したレートよりも良いレートが存在する場合にのみ意味を持ち、台帳にこのフラグを持ったオブジェクトが入ることはありません。)。 |
| フラグ名 | 16進数値 | 10進数値 | 対応する[OfferCreateフラグ](../../transactions/types/offercreate.md#offercreateフラグ) | 説明 |
|--------------|--------------|----------|-------------|------------------------|
| `lsfPassive` | `0x00010000` | 65536 | `tfPassive` | オブジェクトはパッシブオファーとして発注されています。レジャー内のオブジェクトには影響しません。 |
| `lsfSell` | `0x00020000` | 131072 | `tfSell` | オブジェクトは売却オファーとして発注されています。これは台帳にあるオブジェクトには何の影響もありません (`tfSell`は指定したレートよりも良いレートが存在する場合にのみ意味を持ち、台帳にこのフラグを持ったオブジェクトが入ることはありません。)。 |
| `lsfHybrid` | `0x00040000` | 262144 | `tfHybrid` | ハイブリッドオファーとして作成されています。これは、[許可型DEX](../../../../concepts/tokens/decentralized-exchange/permissioned-dexes.md)と公開DEXの両方にリストされていることを意味します。([PermissionedDEX amendment][] {% not-enabled /%}が必要です。) |
## {% $frontmatter.seo.title %}の準備金
@@ -78,6 +81,6 @@ labels:
* オファーを行うアカウントのAccountID
* オファーを作成した[OfferCreateトランザクション][]のシーケンス番号
OfferCreateトランザクションが[Ticket](../../../../concepts/accounts/tickets.md)を使用した場合、代わりに`TicketSequence`値を使用します。
OfferCreateトランザクションが[チケット](../../../../concepts/accounts/tickets.md)を使用した場合、代わりに`TicketSequence`値を使用します。
{% raw-partial file="/@l10n/ja/docs/_snippets/common-links.md" /%}

View File

@@ -100,4 +100,4 @@ _([PermissionedDomains amendment][]が必要です {% not-enabled /%})_
3. 作成した{% code-page-name /%}トランザクションのシーケンス番号
{% raw-partial file="/docs/_snippets/common-links.md" /%}
{% raw-partial file="/@l10n/ja/docs/_snippets/common-links.md" /%}

View File

@@ -55,7 +55,7 @@ AMMのLPトークンを使って落札すると、落札に利用したLPトー
{% raw-partial file="/@l10n/ja/docs/_snippets/tx-fields-intro.md" /%}
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|:---------------|:-----------|:- ----------|:----- |:------------|
|:---------------|:-----------|:------------|:------|:------------|
| `Asset` | オブジェクト | STIssue | はい | AMMのプールにある資産の一つを定義します。JSONでは、`currency``issuer`フィールドを持つオブジェクトになりますXRPの場合は`issuer`を省略します)。 |
| `Asset2` | オブジェクト | STIssue | はい | AMMのプールにあるもう一つのアセットの定義です。JSONでは、`currency``issuer`フィールドを持つオブジェクトになりますXRPの場合は`issuer`を省略します)。 |
| `BidMin` | [通貨額][] | Amount | いいえ | スロットに支払う最小の金額。この値を高く設定すると、他の人から競り落とされにくくなります。省略された場合は、落札に必要な最低額を支払います。 |

View File

@@ -0,0 +1,81 @@
---
seo:
description: 自動マーケットメーカープールに発行済みトークンを預け入れた保有者から、トークンを回収する。
labels:
- AMM
- Tokens
---
# AMMClawback
[[ソース]](https://github.com/XRPLF/rippled/blob/master/src/xrpld/app/tx/detail/AMMClawback.cpp "ソース")
発行したトークンをAMMプールに預け入れた保有者からトークンを回収します。
Clawbackはデフォルトで無効です。Clawbackを使用するには、[AccountSetトランザクション][]を送信して、**Allow Trust Line Clawback**設定を有効にする必要があります。すでにトークンが発行済みである発行者はClawbackを有効にできません。**Allow Trust Line Clawback**を有効にするには、トラストライン、オファー、エスクロー、ペイメントチャネル、チェック、署名者リストを設定する前に、所有者ディレクトリを完全に空にする必要があります。Clawbackを有効にした後は、元に戻すことはできません。つまり発行者アカウントは、トラストラインの発行済みトークンを回収できる権利を永続的に得ます。
_([AMMClawback amendment][]により追加されました。)_
## {% $frontmatter.seo.title %} JSONの例
```json
{
"TransactionType": "AMMClawback",
"Account": "rPdYxU9dNkbzC5Y2h4jLbVJ3rMRrk7WVRL",
"Holder": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"Asset": {
"currency" : "FOO",
"issuer" : "rPdYxU9dNkbzC5Y2h4jLbVJ3rMRrk7WVRL"
},
"Asset2" : {
"currency" : "BAR",
"issuer" : "rHtptZx1yHf6Yv43s1RWffM3XnEYv3XhRg"
},
"Amount": {
"currency" : "FOO",
"issuer" : "rPdYxU9dNkbzC5Y2h4jLbVJ3rMRrk7WVRL",
"value" : "1000"
}
}
```
{% raw-partial file="/@l10n/ja/docs/_snippets/tx-fields-intro.md" /%}
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|:-----------|:----------------------|:-------------|:-------|:------------------|
| `Account` | 文字列 - [アドレス][] | AccountID | はい | 回収する資産の発行者。このトランザクションは、発行者のみが送信できます。 |
| `Asset` | オブジェクト | Issue | はい | AMMプールから回収したい資産を指定します。資産はXRP、トークン、またはMPT[金額なしの指定][]を参照)です。`issuer`フィールドは`Account`と一致していなければなりません。 |
| `Asset2` | オブジェクト | Issue | はい | AMMのプール内のもう一方の資産を指定します。資産はXRP、トークン、またはMPT[金額なしの指定][]を参照)です。 |
| `Amount` | [通貨額][] | Amount | いいえ | AMMアカウントから回収する最大額を指定します。`currency``issuer`サブフィールドは`Asset`サブフィールドと一致していなければなりません。このフィールドが指定されていない場合、または`value`サブフィールドがAMMの保有者の利用可能なトークンを超えている場合、保有者のすべてのトークンが回収されます。 |
| `Holder` | 文字列 - [アドレス][] | AccountID | はい | 回収する資産を保有しているアカウント。 |
## AMMClawbackのフラグ
| フラグ名 | Hex値 | 10進数値 | 説明 |
|-------------------|--------------|----------|-------------|
| `tfClawTwoAssets` | `0x00000001` | 1 | `Asset`の指定額を回収し、AMMプールの資産比率に基づいて`Asset2`の対応する額を回収します。両方の資産は`Account`フィールドの発行者によって発行されなければなりません。このフラグが有効でない場合、発行者は`Asset`の指定された額を回収しますが、`Asset2`の対応する比率は`Holder`に返されます。 |
## エラーのケース
すべてのトランザクションで発生する可能性のあるエラーに加えて、`AMMClawback`トランザクションは以下の[トランザクション結果コード](../transaction-results/index.md)をもたらすことがあります。
| エラーコード | 説明 |
|:-------------------|:------------|
| `tecNO_PERMISSION` | `lsfAllowTrustlineClawback` フラグが有効になっていない状態で AMM からトークンを回収しようとした場合、または AMM で両方の資産を発行していない状態で `tfClawTwoAssets` フラグが有効になっている場合に発生します。また、`Asset` の発行者が `Account` と一致しない場合にも発生します。 |
| `tecAMM_BALANCE` | `Holder`がAMMプールのLPトークンを保有していない場合に発生します。 |
| `temDISABLED` | [AMMClawback amendment][]が有効になっていない場合に発生します。 |
| `temBAD_AMOUNT` | `AMMClawback`トランザクションの`Amount`フィールドが0以下の場合、または`currency``issuer`サブフィールドが`Amount``Asset`の間で一致しない場合に発生します。 |
| `temINVALID_FLAG` | `tfClawTwoAssets`以外のフラグを有効にしようとした場合に発生します。 |
| `temMALFORMED` | `issuer`サブフィールドが`Asset``Account`の間で一致しない場合、`Account``Holder`と同じ場合、または`Asset`がXRPの場合に発生します。 |
| `terNO_AMM` | `Asset``Asset2`で指定されたAMMプールが存在しない場合に発生します。 |
## 関連項目
- [AMMエントリ][]
{% raw-partial file="/@l10n/ja/docs/_snippets/common-links.md" /%}

View File

@@ -39,12 +39,12 @@ AMMを表す[AMMエントリ][]と[特殊なAccountRootエントリ](../../ledge
{% raw-partial file="/@l10n/ja/docs/_snippets/tx-fields-intro.md" /%}
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|:-------------|:---- -----|:-----------|:------|:------------|
|:-------------|:----------|:-----------|:------|:------------|
| `Amount` | [通貨額][] | Amount | はい | このAMMの最初の資金となる2つの資産のうち、1つ目の資産です。これは正数である必要があります。 |
| `Amount2` | [通貨額][] | Amount | はい | このAMMの最初の資金となる2つの資産のうち、2つ目の資産です。これは正数である必要があります。 |
| `TradingFee` | 数値 | UInt16 | はい | このAMMインスタンスに対する取引に課される手数料を1/100,000単位で指定します値1は0.001%に相当)。最大値は`1000`で、1%の手数料を意味します。最小値は `0`です。 |
`Amount``Amount2`の一方または両方は[トークン](../../../../concepts/tokens/index.md)であり、最大でどちらか一方を[XRP](../../../../introduction/what-is-xrp.md)にすることが可能です。通貨コードと発行者が同じものは使用できません。AMMのLPトークンは、別のAMMの資産の1つとして使用することができます。トークンの発行者は[Default Ripple](../../../../concepts/tokens/fungible-tokens/rippling.md#defaultrippleフラグ)を有効にしていなければなりません。[Clawback Amendment][] が有効になっている場合、それらの発行者はAllow Clawbackフラグを有効にしていてはいけません。AMMのLPトークンは、別のAMMの資産の一つとして使用することはできません。
`Amount``Amount2`の一方または両方は[トークン](../../../../concepts/tokens/index.md)であり、最大でどちらか一方を[XRP](../../../../introduction/what-is-xrp.md)にすることが可能です。通貨コードと発行者が同じものは使用できません。AMMのLPトークンは、別のAMMの資産の1つとして使用することができます。トークンの発行者は[Default Ripple](../../../../concepts/tokens/fungible-tokens/rippling.md#defaultrippleフラグ)を有効にしていなければなりません。AMMのLPトークンは、別のAMMの資産の一つとして使用することはできません。
## 特殊なトランザクションコスト
@@ -54,17 +54,19 @@ AMMを表す[AMMエントリ][]と[特殊なAccountRootエントリ](../../ledge
すべてのトランザクションで発生する可能性のあるエラーに加えて、{% $frontmatter.seo.title %}トランザクションでは、次の[トランザクション結果コード](../transaction-results/index.md)が発生する可能性があります。
| エラーコード | 説明 |
| エラーコード | 説明 |
|:--------------------|:---------------------------------------------|
| `temDISABLED` | このネットワークでは、AMM機能 |
| `temINVALID_FLAG` | トランザクションに無効な`Flags`値が指定されています。現在、このトランザクションタイプに定義されたフラグはないので、[グローバルフラグ](../common-fields.md#グローバルフラグ)のみが許可されます。 |
| `temBAD_AMM_TOKENS` | `Amount``Amount2`値が正しくありません。例えば、両方とも同じトークンを参照している場合です。 |
| `temBAD_FEE` | `TradingFee`の値が不正です。ゼロまたは正の整数でなければならず、1000を超えることはできません。 |
| `terNO_ACCOUNT` | リクエストで参照されたいずれかのアカウントが存在しません。|
| `tecNO_AUTH` | 送信者は資産`Amount`または`Amount2`)のいずれかを保有する権限がありません。 |
| `tecNO_LINE` | 送信者は資産(`Amount`または`Amount2`のうちいずれか1つに対するトラストラインを保有していません。 |
| `tecFROZEN` | 資産(`Amount`または`Amount2`の少なくとも1つが現在[フリーズ](../../../../concepts/tokens/fungible-tokens/freezes.md)されています。 |
| `tecAMM_INVALID_TOKENS` | `Amount`または`Amount2`が、このAMMのLPトークンと同じ通貨コードを使用しています。(これが起こることは稀です。) |
| `tecDUPLICATE` | この通貨ペアを扱っているAMMが既に存在しています。 |
| `tecFROZEN` | 資産(`Amount`または`Amount2`)の少なくとも1つが現在[フリーズ](../../../../concepts/tokens/fungible-tokens/freezes.md)されています。 |
| `tecINSUF_RESERVE_LINE` | 送信者は、このトランザクションを処理するための[準備金要件](../../../../concepts/accounts/reserves.md)を満たしていません。おそらく、LPトークンを保持するための新しいトラストラインが必要で、新しいトラストラインの所有者準備金を満たす十分なXRPを持っていないためです。 |
| `tecNO_AUTH` | 送信者は資産(`Amount`または`Amount2`)のいずれかを保有する権限がありません。 |
| `tecNO_LINE` | 送信者は資産(`Amount`または`Amount2`)のうちいずれか1つに対するトラストラインを保有していません。 |
| `tecNO_PERMISSION` | 少なくとも1つの入金資産はAMMで使用できません。 |
| `tecUNFUNDED_AMM` | 送信者は`Amount``Amount2`で指定された金額をAMMに入金するための十分な資金を保有していません。 |
| `tecAMM_EXISTS` | この通貨ペアを扱っているAMMが既に存在していま。 |
| `terNO_RIPPLE` | 少なくとも1つの資産の発行者が[Default Rippleフラグ](../../../../concepts/tokens/fungible-tokens/rippling.md#defaultrippleフラグ)を有効にしていません。 |
| `temAMM_BAD_TOKENS` | `Amount``Amount2`値が正しくありません。例えば、両方とも同じトークンを参照している場合です。 |
| `temBAD_FEE` | `TradingFee`の値が不正です。ゼロまたは正の整数でなければならず、1000を超えることはできません。 |
| `temDISABLED` | このネットワークでは、AMM機能が無効になっています。 |
{% raw-partial file="/@l10n/ja/docs/_snippets/common-links.md" /%}

View File

@@ -137,7 +137,7 @@ AMMDepositトランザクションは、以下のような[`Flags`フィール
| `tecAMM_EMPTY` | 現在、AMM は資産を保有していないため、通常の入金はできません。代わりに、空のAMMの場合の特殊な入金を行う必要があります。 |
| `tecAMM_NOT_EMPTY` | トランザクションで`tfTwoAssetIfEmpty`が指定されましたが、AMMは空ではありませんでした。 |
| `tecAMM_FAILED` | 預け入れの条件が成立しませんでした。例えば、`EPrice`フィールドに指定された実効価格が低すぎる場合など。 |
| `tecFROZEN` | トランザクションは[フリーズ](../../../../concepts/tokens/fungible-tokens/freezes.md)されているトークンを預けようとしました。 |
| `tecFROZEN` | トランザクションは[フリーズ](../../../../concepts/tokens/fungible-tokens/freezes.md)されているトークンを預けようとした、またはプール内の資産の少なくとも1つがフリーズされています。 |
| `tecINSUF_RESERVE_LINE` | このトランザクションの送信者は、この処理による[準備金要件](../../../../concepts/accounts/reserves.md)の増加の対象であり、LPトークンを保持するための新しいトラストラインが必要で、そのための追加の所有者準備金分のXRPを保有していないためと思われます。 |
| `tecUNFUNDED_AMM` | 送信者の残高が、指定された預け入れを行うのに十分な量ではありません。 |
| `temBAD_AMM_TOKENS` | トランザクションでLPトークンを指定しましたが、`issuer`がAMMに紐づくAccountアドレスではない、または`currency`がこのAMMのLPトークンの通貨コードではない、またはトランザクションでこのAMMのLPトークンをAssetフィールドのいずれかに指定しました。 |

View File

@@ -170,4 +170,4 @@ status: not_enabled
| `temINVALID_INNER_BATCH` | 内部トランザクションの形式が不正です。 |
| `temSEQ_AND_TICKET` | トランザクションに`TicketSequence`フィールドと、0以外の`Sequence`フィールドの両方が含まれています。両方を同時に指定することはできませんが、いずれか一方は必須です。 |
{% raw-partial file="/docs/_snippets/common-links.md" /%}
{% raw-partial file="/@l10n/ja/docs/_snippets/common-links.md" /%}

View File

@@ -1,7 +1,6 @@
---
html: mptokenauthorize.html
parent: transaction-types.html
blurb: アカウントが特定のMPTの残高を保持することを許可します。
seo:
description: アカウントが特定のMPTの残高を保持することを許可します。
labels:
- Multi-Purpose Token, MPT
---

View File

@@ -1,7 +1,6 @@
---
html: mptokenissuancecreate.html
parent: transaction-types.html
blurb: 新しいMulti-Purpose Tokenを発行します。
seo:
description: 新しいMulti-Purpose Tokenを発行します。
labels:
- Multi-Purpose Token, MPT
---

View File

@@ -1,7 +1,6 @@
---
html: mptokenissuancedestroy.html
parent: transaction-types.html
blurb: レジャーからMulti-Purpose Tokenを削除します。
seo:
description: Multi-Purpose Tokenを削除します。
labels:
- Multi-Purpose Token, MPT
---

View File

@@ -1,7 +1,6 @@
---
html: mptokenissuanceset.html
parent: transaction-types.html
blurb: MPTの変更可能なプロパティを設定します。
seo:
description: MPTの変更可能なプロパティを設定します。
labels:
- Multi-Purpose Token, MPT
---

View File

@@ -34,43 +34,46 @@ OfferCreateトランザクションは[分散型取引所](../../../../concepts/
{% raw-partial file="/@l10n/ja/docs/_snippets/tx-fields-intro.md" /%}
| フィールド | JSONの型 | [内部の型][] | 説明 |
|:-----------------|:----------|:------------|:-----------|
| [Expiration](../../../../concepts/tokens/decentralized-exchange/offers.md#オファーの有効期限) | 数字 | UInt32 | _省略可_ オファーがアクティブでなくなるまでの時間([Rippleエポック以降の経過秒数][])。 |
| `OfferSequence` | 数 | UInt32 | _省略可_ 最初に削除されるオファー([OfferCancel][]と同様に指定されます)。 |
| `TakerGets` | [通貨額][] | Amount | オファーの作成者によって作成される金額および通貨の種類。 |
| `TakerPays` | [通貨額][] | Amount | オファーの作成者によってリクエストされる金額および通貨の種類。 |
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|:-----------------|:----------------------|:-------------|:---------|:-----------|
| `DomainID` | 文字列 - [ハッシュ][] | Hash256 | いいえ | 許可型DEXのレジャーエントリID。指定された場合、対応する[許可型DEX](../../../../concepts/tokens/decentralized-exchange/permissioned-dexes.md)のみを使用するパスを返します。([PermissionedDEX amendment][] {% not-enabled /%}が必要です。) |
| [`Expiration`](../../../../concepts/tokens/decentralized-exchange/offers.md#オファーの有効期限) | 数 | UInt32 | いいえ | オファーがアクティブでなくなるまでの時間([Rippleエポック以降の経過秒数][])。 |
| `OfferSequence` | 整数 | UInt32 | いいえ | 最初に削除されるオファー([OfferCancel][]と同様に指定されます)。 |
| `TakerGets` | [通貨額][] | Amount | はい | オファーの作成者によって作成される金額および通貨の種類。 |
| `TakerPays` | [通貨額][] | Amount | はい | オファーの作成者によってリクエストされる金額および通貨の種類。 |
## OfferCreateフラグ
OfferCreate型のトランザクションについては、[`Flags`フィールド](../common-fields.md#flagsフィールド)で以下の値が追加でサポートされます。
| フラグ名 | 16進数 | 10進数 | 説明 |
| フラグ名 | 16進数 | 10進数 | 説明 |
|:----------------------|:-------------|:--------------|:-------------------|
| `tfPassive` | `0x00010000` | 65536 | 有効な場合、オファーはオファー完全に約定するオファーを消費せず、代わりにレジャーのOfferオブジェクトになります。それはまだクロスしたオファーを消費します。 |
| `tfImmediateOrCancel` | `0x00020000` | 131072 | オファーを[IOC注文](http://en.wikipedia.org/wiki/Immediate_or_cancel)として扱います。有効な場合、オファーはレジャーオブジェクトにはなりません。レジャー内の既存のオファーと約定させようとするだけです。即時にオファーがどのオファーとも約定しない場合、どの通貨とも取引せずに「正常に」実行します。この場合、トランザクションは`tesSUCCESS`の[結果コード](../transaction-results/index.md)を返しますが、レジャー内には、[Offerオブジェクト](../../ledger-data/ledger-entry-types/offer.md)を作成しません。 |
| `tfFillOrKill` | `0x00040000` | 262144 | オファーを[FOK注文](http://en.wikipedia.org/wiki/Fill_or_kill)として扱います。レジャー内の既存のオファーのみを約定しようとします。またこれは、全`TakerPays`の数量が取得できる場合に限られます。[fix1578 amendment][]が有効な場合でオファーを配置した時に実行できない場合、トランザクションは`tecKILLED`の[結果コード](../transaction-results/index.md)を返します。そうでない場合は、トランザクションは、どの通貨とも取り引きせずにキャンセルされた場合でも`tesSUCCESS`の結果コードを返します。 |
| `tfSell` | `0x00080000` | 524288 | 取引所で`TakerPays`Amountよりも多く取得することになっても、`TakerGets` Amountを交換します。 |
| `tfPassive` | `0x00010000` | 65536 | このオファー完全に一致するオファーを約定しません。これにより、特定の値で交換レートを固定するオファーを台帳に設定できます。 |
| `tfImmediateOrCancel` | `0x00020000` | 131072 | オファーを[即時またはキャンセル注文](http://en.wikipedia.org/wiki/Immediate_or_cancel)として扱い、[Offerエントリ][]をオーダーブックに配置しません。トランザクションは、処理時に既存のオファーを約定し、可能な限り多くの取引を行います。 |
| `tfFillOrKill` | `0x00040000` | 262144 | オファーを[即時またはキャンセル注文](http://en.wikipedia.org/wiki/Fill_or_kill)として扱い、[Offerエントリ][]をオーダーブックに配置しません。実行時に完全に約定できない場合、オファーをキャンセルします。デフォルトでは、所有者は完全な`TakerPays`の金額を受け取る必要があります。`tfSell`フラグが有効な場合、所有者は代わりに完全な`TakerGets`の金額を約定できる必要があります。 |
| `tfSell` | `0x00080000` | 524288 | 取引所で`TakerPays`の金額よりも多く取得することになっても、`TakerGets`の金額を約定します。 |
| `tfHybrid` | `0x00100000` | 1048576 | 許可型DEXとオープンDEXの両方を使用できるハイブリッドオファーにします。このフラグを使用する場合、`DomainID`フィールドを指定する必要があります。 |
## エラーケース
| エラーコード | 説明 |
| エラーコード | 説明 |
|:-------------------------|:--------------------------------------------------|
| `temINVALID_FLAG` | トランザクションが`tfImmediateOrCancel``tfFillOrKill`両方を指定した場合に発生します。|
| `tecEXPIRED` | トランザクションが指定した`Expiration`の時間が既に経過している場合に発生します。 |
| `tecKILLED` | トランザクションが`tfFillOrKill`を指定し、全額を約定できない場合に発生します。_[ImmediateOfferKilled amendment][]_ が有効な場合、この結果コードは、トランザクションが`tfImmediateOrCancel`を指定して資金が移動せずに実行された場合にも発生します(これまでは、これは`tesSUCCESS`を返していました)。 |
| `temBAD_EXPIRATION` | トランザクションの`Expiration`フィールドの値が無効なフォーマットの場合に発生します。 |
| `temBAD_SEQUENCE` | トランザクションの`OfferSequence`フィールドの値が無効なフォーマットであるか、トランザクション自身の`Sequence`番号より大きい場合に発生します。 |
| `temBAD_OFFER` | OfferがXRPとXRPを交換しようとした場合、またはトークンの無効な量やマイナスの量を交換しようとした場合に発生します。 |
| `temREDUNDANT` | トランザクションが同じトークン(同じ発行者、通貨コード)を指定した場合に発生します。 |
| `temBAD_CURRENCY` | トランザクションで通貨コードが"XRP"のトークンが指定された場合に発生します。 |
| `temBAD_ISSUER` | トランザクションが無効な`issuer`値を持つトークンを指定した場合に発生します。 |
| `tecNO_ISSUER` | トランザクションで、`issuer`の値が台帳の有効化されたアカウントでないトークンを指定した場合に発生します。|
| `tecFROZEN` | [フリーズ](../../../../concepts/tokens/fungible-tokens/freezes.md)されたトラストライン(ローカルおよびグローバルのフリーズを含む)上のトークンを含むトランザクションの場合に発生します。`TakerPays`(購入額)トークンが発行者によってディープフリーズされている場合に発生します。 |
| `tecUNFUNDED_OFFER` | トランザクションの送信者が`TakerGets`の通貨を正の値で保有していない場合に発生する。(例外: `TakerGets`にトランザクションの送信者が発行するトークンを指定した場合、トランザクションは成功します)。 |
| `tecNO_LINE` | 発行者が[Authorized Trust Lines](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md)を使用しているトークンを含むトランザクションで、必要なトラストラインが存在しない場合に発生します。 |
| `tecNO_AUTH` | 発行者が[Authorized Trust Lines](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md)を使用しているトークンを含むトランザクションで、トークンを受け取るトラストラインが存在するが認証されていない場合に発生します。 |
| `tecINSUF_RESERVE_OFFER` | 所有者が台帳に新しいOfferオブジェクトを追加するための準備要件を満たすのに十分なXRPを持っておらず、トランザクションがどの通貨も変換しなかった場合に発生します。(トランザクションが何らかの金額のトレードに成功した場合、トランザクションは結果コード`tesSUCCESS`で成功しますが、残りは台帳にOfferオブジェクトを作成しません)。 |
| `tecDIR_FULL` | トランザクションの送信者が台帳で多くのアイテムを所有している場合、またはオーダーブックに同じ取引レートのオファーがすでに多く含まれている場合に発生します。 |
| `tecEXPIRED` | トランザクションが指定した`Expiration`の時間が既に経過している場合に発生します。 |
| `tecFROZEN` | [フリーズ](../../../../concepts/tokens/fungible-tokens/freezes.md)されたトラストライン(ローカルおよびグローバルのフリーズを含む)上のトークンを含むトランザクションの場合に発生します。`TakerPays`(購入額)トークンが発行者によってディープフリーズされている場合に発生します。 |
| `tecINSUF_RESERVE_OFFER` | 所有者が台帳に新しいOfferオブジェクトを追加するための準備要件を満たすのに十分なXRPを持っておらず、トランザクションがどの通貨も変換しなかった場合に発生します。(トランザクションが何らかの金額のトレードに成功した場合、トランザクションは結果コード`tesSUCCESS`で成功しますが、残りは台帳にOfferオブジェクトを作成しません)。 |
| `tecKILLED` | トランザクションが`tfFillOrKill`を指定し、全額を約定できない場合に発生します。_[ImmediateOfferKilled amendment][]_ が有効な場合、この結果コードは、トランザクションが`tfImmediateOrCancel`を指定して資金が移動せずに実行された場合にも発生します(これまでは、これは`tesSUCCESS`を返していました)。 |
| `tecNO_AUTH` | 発行者が[Authorized Trust Lines](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md)を使用しているトークンを含むトランザクションで、トークンを受け取るトラストラインが存在するが認証されていない場合に発生します。 |
| `tecNO_ISSUER` | トランザクションで、`issuer`の値が台帳の有効化されたアカウントでないトークンを指定した場合に発生します。|
| `tecNO_LINE` | 発行者が[Authorized Trust Lines](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md)を使用しているトークンを含むトランザクションで、必要なトラストラインが存在しない場合に発生します。 |
| `tecNO_PERMISSION` | トランザクションが`DomainID`を使用しているが、送信者がそのドメインのメンバーではない場合に発生します。([PermissionedDEX amendment][] {% not-enabled /%}) |
| `tecUNFUNDED_OFFER` | トランザクションの送信者が`TakerGets`の通貨を正の値で保有していない場合に発生する。(例外: `TakerGets`にトランザクションの送信者が発行するトークンを指定した場合、トランザクションは成功します)。 |
| `temBAD_CURRENCY` | トランザクションで通貨コードが"XRP"のトークンが指定された場合に発生します。 |
| `temBAD_EXPIRATION` | トランザクションの`Expiration`フィールドの値が無効なフォーマットの場合に発生します。 |
| `temBAD_ISSUER` | トランザクションが無効な`issuer`値を持つトークンを指定した場合に発生します。 |
| `temBAD_OFFER` | OfferがXRPとXRPを交換しようとした場合、またはトークンの無効な量やマイナスの量を交換しようとした場合に発生します。 |
| `temBAD_SEQUENCE` | トランザクションの`OfferSequence`フィールドの値が無効なフォーマットであるか、トランザクション自身の`Sequence`番号より大きい場合に発生します。 |
| `temINVALID_FLAG` | トランザクションが`tfImmediateOrCancel``tfFillOrKill`両方を指定した場合に発生します。|
| `temREDUNDANT` | トランザクションが同じトークン(同じ発行者、通貨コード)を指定した場合に発生します。 |
{% raw-partial file="/@l10n/ja/docs/_snippets/common-links.md" /%}

View File

@@ -1,7 +1,6 @@
---
html: oracledelete.html
parent: transaction-types.html
blurb: 既存の価格オラクルを削除します。
seo:
description: 既存の価格オラクルを削除します。
labels:
- オラクル
---

View File

@@ -1,7 +1,6 @@
---
html: OracleSet.html
parent: transaction-types.html
blurb: 価格オラクルを作成または更新します。
seo:
description: 価格オラクルを作成または更新します。
labels:
- オラクル
---

View File

@@ -8,7 +8,7 @@ labels:
- トークン
---
# Payment
[[ソース]](https://github.com/XRPLF/rippled/blob/5425a90f160711e46b2c1f1c93d68e5941e4bfb6/src/ripple/app/transactors/Payment.cpp "ソース")
[[ソース]](https://github.com/XRPLF/rippled/blob/master/src/xrpld/app/tx/detail/Payment.cpp "ソース")
Paymentトランザクションは、アカウント間での価値の移動を表現するものです(通過するパスによっては、非可分的に発生する追加的な価値交換を伴うことがあります)。このトランザクションタイプはいくつかの[支払いの種類](#paymentの種類)に使用することがでできます。
@@ -37,17 +37,18 @@ Paymentは、[アカウントを作成](#アカウントの作成)する唯一
{% raw-partial file="/@l10n/ja/docs/_snippets/tx-fields-intro.md" /%}
| フィールド | JSONの型 | [内部の型][] | 説明 |
| :--------------- | :------------------ | :----------- | ---- |
| `Amount` | [通貨額][] | Amount | `DeliverMax`のエイリアス |
| `CredentialIDs` | 文字列の配列 | Vector256 | このトランザクションによって作成される入金を承認するための、受取人によって事前承認された資格証明のセット。配列の各メンバは、レジャーのCredentialエントリのレジャーエントリIDでなければなりません。(_[**Credentials** amendment](../../../../../resources/known-amendments.md#credentials)が必要です。_ {% not-enabled /%}) |
| `DeliverMax` | [Currency Amount][] | Amount | [API v2][]: 送金する通貨額。XRP以外の金額の場合、入れ子フィールドの名前では、アルファベットの小文字のみ使用してください。[**tfPartialPayment**フラグ](#paymentのフラグ)が設定されている場合は、この金額を _上限_ とする金額を送金します。 {% badge href="https://github.com/XRPLF/rippled/releases/tag/2.0.0" %}新規: rippled 2.0.0{% /badge %} |
| `DeliverMin` | [通貨額][] | Amount | _省略可_ このトランザクションで送金する、宛先通貨での最少金額。[Partial Payments](../../../../concepts/payment-types/partial-payments.md)の場合のみ有効になります。XRP以外の金額の場合、入れ子フィールドの名前では、アルファベットの小文字のみ使用してください。 |
| `Destination` | 文字列 | AccountID | 支払いを受取るアカウントの一意アドレス。 |
| `DestinationTag` | 数値 | UInt32 | _省略可_ 宛先(支払先となる、ホスティングされている受取人)への支払い理由を明確にするための任意のタグ。 |
| `InvoiceID` | 文字列 | UInt256 | _省略可_ この支払いの具体的な理由または識別子を表現する任意の256ビットハッシュ。 |
| `Paths` | パス配列の配列 | PathSet | (省略可。自動入力可能)このトランザクションに使用される[支払いパス](../../../../concepts/tokens/fungible-tokens/paths.md)の配列。XRP間のトランザクションでは省略する必要があります。 |
| `SendMax` | [通貨額][] | Amount | _省略可_ [送金手数料](../../../../concepts/tokens/transfer-fees.md)、為替レート、[スリッページ](http://en.wikipedia.org/wiki/Slippage_%28finance%29)を含め、このトランザクションに関して支払い元通貨での負担を許容する上限額。[トランザクションの送信コストとしてバーンされるXRP](../../../../concepts/transactions/transaction-cost.md)は含めないでください。XRP以外の金額の場合、入れ子フィールドの名前では、アルファベットの小文字のみ使用してください。クロスカレンシー支払いまたは複数のトークンを伴う支払いについては、このフィールドを入力する必要があります。XRP間の支払いでは省略する必要があります。 |
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
| :--------------- | :-------------------- | :----------- | :---------- | :---- |
| `Amount` | [通貨額][] | Amount | APIv1: はい | `DeliverMax`のエイリアス |
| `CredentialIDs` | 文字列の配列 | Vector256 | いいえ | このトランザクションによって作成される入金を承認するための、受取人によって事前承認された資格証明のセット。配列の各メンバは、レジャーのCredentialエントリのレジャーエントリIDでなければなりません。(_[**Credentials** amendment](../../../../../resources/known-amendments.md#credentials)が必要です。_ {% not-enabled /%}) |
| `DeliverMax` | [通貨額][] | Amount | はい | [API v2][]: 送金する通貨額。XRP以外の金額の場合、入れ子フィールドの名前では、アルファベットの小文字のみ使用してください。[**tfPartialPayment**フラグ](#paymentのフラグ)が設定されている場合は、この金額を _上限_ とする金額を送金します。 {% badge href="https://github.com/XRPLF/rippled/releases/tag/2.0.0" %}新規: rippled 2.0.0{% /badge %} |
| `DeliverMin` | [通貨額][] | Amount | いいえ | _省略可_ このトランザクションで送金する、宛先通貨での最少金額。[Partial Payments](#partial-payments)の場合のみ有効になります。XRP以外の金額の場合、入れ子フィールドの名前では、アルファベットの小文字のみ使用してください。 |
| `Destination` | 文字列 - [アドレス][] | AccountID | はい | 支払いを受取るアカウントの一意アドレス。 |
| `DestinationTag` | 数値 | UInt32 | いいえ | 宛先(支払先となる、ホスティングされている受取人)への支払い理由を明確にするための任意のタグ。 |
| `DomainID` | String - [Hash][] | Hash256 | いいえ | 許可されたドメインのレジャーエントリID。クロスカレンシー支払いの場合は、通貨を変換するために、対応する[許可されたDEX](../../../../concepts/tokens/decentralized-exchange/permissioned-dexes.md)のみを使用してください。送信者と受取人の両方が、指定されたドメインへのアクセスを許可する有効な資格証明を持っている必要があります。このフィールドは、クロスカレンシー支払いではない場合は効果がありません。(_[**PermissionedDEX** amendment][]が必要です。_ {% not-enabled /%}) |
| `InvoiceID` | 文字列 - 16進文字 | UInt256 | いいえ | この支払いの具体的な理由または識別子を表現する任意の256ビットハッシュ。 |
| `Paths` | パス配列の配列 | PathSet | いいえ | _自動入力可能_ このトランザクションに使用される[支払いパス](../../../../concepts/tokens/fungible-tokens/paths.md)の配列。XRP間のトランザクションでは省略する必要があります。 |
| `SendMax` | [通貨額][] | Amount | いいえ | [送金手数料](../../../../concepts/tokens/transfer-fees.md)、為替レート、[スリッページ](http://en.wikipedia.org/wiki/Slippage_%28finance%29)を含め、このトランザクションに関して支払い元通貨での負担を許容する上限額。[トランザクションの送信コストとしてバーンされるXRP](../../../../concepts/transactions/transaction-cost.md)は含めないでください。XRP以外の金額の場合、入れ子フィールドの名前では、アルファベットの小文字のみ使用してください。クロスカレンシー支払いまたは複数のトークンを伴う支払いについては、このフィールドを入力する必要があります。XRP間の支払いでは省略する必要があります。 |
トランザクションを指定する際は、`Amount`または`DeliverMax`のいずれかを指定する必要がありますが、両方を指定することはできません。JSONでトランザクションを表示する場合、API v1では常に`Amount`を使用し、API v2以降では常に`DeliverMax`を使用します。
@@ -62,7 +63,7 @@ Paymentトランザクションタイプは、いくつかの異なるタイプ
| [クロスカレンシー(通貨間)決済][] | オブジェクト (非XRP) / 文字列 (XRP) | オブジェクト (非XRP) / 文字列 (XRP) | 通常は必須 | いいえ | 発行された通貨を保有者から別の保有者に送信します。`Amount``SendMax`の両方をXRPにすることはできません。これらの支払いは、発行者を介して[リップリング](../../../../concepts/tokens/fungible-tokens/rippling.md)し、トランザクションがパスセットを指定した場合、複数の仲介者を介してより長い[パス](../../../../concepts/tokens/fungible-tokens/paths.md)を取ることができます。トランザクション形式には、発行者が設定した[送金手数料](../../../../concepts/tokens/transfer-fees.md) が適用されます。これらのトランザクションは、異なる通貨間や、場合によっては同じ通貨コードで異なる発行者の通貨間を接続するために、[分散型取引所](../../../../concepts/tokens/decentralized-exchange/index.md)のオファーを利用します。 |
| [Partial payment][] | オブジェクト (非XRP) / 文字列 (XRP) | オブジェクト (非XRP) / 文字列 (XRP) | 通常は必須 | いいえ | 任意の通貨を特定の金額まで送ります。[`tfPartialPayment` フラグ](#paymentのフラグ)を使用します。トランザクションが成功するための最小値を指定する `DeliverMin` 値を含めることができます。トランザクションが `DeliverMin` を指定しない場合、_任意の正の値_ を指定して成功させることができる。 |
| 通貨変換 | オブジェクト (非XRP) / 文字列 (XRP) | オブジェクト (非XRP) / 文字列 (XRP) | 必須 | はい | [分散型取引所](../../../../concepts/tokens/decentralized-exchange/index.md)のオファーを消費して、ある通貨を別の通貨に交換し、[裁定取引](https://ja.wikipedia.org/wiki/%E8%A3%81%E5%AE%9A%E5%8F%96%E5%BC%95)の機会を得ることが出来ます。`Amount``SendMax` の両方を XRP にすることはできません。[Data API](../../../data-api.md) は、このタイプの取引を "payment" ではなく、"exchange" として追跡しています。 |
| MPTの支払い | オブジェクト | 省略 | 省略 | はい | MPTを保有者に送信します。[MPTの支払い](#mpt-payments)をご覧ください。 |
| MPTの支払い | オブジェクト | 省略 | 省略 | いいえ | MPTを保有者に送信します。[MPTの支払い](#mpt-payments)をご覧ください。 |
[XRP同士の直接支払い]: ../../../../concepts/payment-types/direct-xrp-payments.md
[発行通貨の作成・償還]: ../../../../concepts/tokens/index.md
@@ -74,11 +75,11 @@ Paymentトランザクションタイプは、いくつかの異なるタイプ
ほとんどの場合、XRP以外の[通貨額][]の`issuer`フィールドは、金融機関の[発行アドレス](../../../../concepts/accounts/account-types.md)を示しています。ただし、支払いを記述するにあたって、支払いの`Amount`フィールドと`SendMax`フィールドにある`issuer`フィールドについては、特殊なルールが存在します。
ほとんどの場合、XRP以外の[通貨額][]の`issuer`フィールドは、金融機関の[発行アドレス](../../../../concepts/accounts/account-types.md)を示しています。ただし、支払いを記述するにあたって、支払いの`DeliverMax`(または`Amount`)フィールドと`SendMax`フィールドにある`issuer`フィールドについては、特殊なルールが存在します。
* 2つのアドレス間で、同一の通貨に関して存在する残高は常に1つです。つまり、金額の`issuer`フィールドが実際に表しているのは、イシュアンスを作成したアドレスではなく、イシュアンスを換金する相手方であることがあります。
* 宛先`Amount`フィールドの`issuer`フィールドが`Destination`アドレスと一致している場合、「宛先が受け入れるあらゆるイシュアー」を意味する特殊なケースとして取り扱われます。これには、他のトラストラインで保持されている宛先によって作成されたイシュアンスに加え、宛先が当該アドレスまでトラストラインを延長しているすべてのアドレスが含まれます。
* `SendMax`フィールドの`issuer`フィールドが送信元アカウントのアドレスと一致している場合、「送信元が使用できるあらゆるイシュアー」を意味する特殊なケースとして取り扱われます。これには、他のアカウントが送信元アカウントまで延長しているトラストラインで新しいイシュアンスを作成すること、送信元アカウントが保持しているイシュアンスを他のイシュアーから送信することが含まれます。
* 宛先`DeliverMax`フィールドの`issuer`フィールドが`Destination`アドレスと一致している場合、「宛先が受け入れるあらゆるイシュアー」を意味する特殊なケースとして取り扱われます。これには、他のトラストラインで保持されている宛先によって作成されたイシュアンスに加え、宛先が当該アドレスまでトラストラインを延長しているすべてのアドレスが含まれます。
* `SendMax`フィールドの`issuer`フィールドが送信元アカウントのアドレスと一致している場合、「送信元が使用できるあらゆるイシュアー」を意味する特殊なケースとして取り扱われます。送信元アカウントが既に保有しているトークンを送信するか、送信元アカウントと信頼関係にある他のユーザーに対して新しいトークンを発行することができます。
## アカウントの作成
@@ -108,7 +109,7 @@ Payment型のトランザクションについては、[`Flags`フィールド](
| フラグの名前 | 16進値 | 10進値 | 説明 |
| :----------------- | :----------- | :----- | ---- |
| `tfNoRippleDirect` | `0x00010000` | 65536 | デフォルトパスを使用せず、`Paths`フィールドに含まれているパスのみ使用します。これによりトランザクションは強制的に裁定機会を活用することになります。ほとんどのクライアントでは、これは必要ありません。 |
| `tfPartialPayment` | `0x00020000` | 131072 | `SendMax`を超えていないのに指定された`Amount`を送金できない場合、即座に失敗とするのではなく、受取られる額を減額します。詳細は、[Partial Payments](../../../../concepts/payment-types/partial-payments.md)をご覧ください。 |
| `tfPartialPayment` | `0x00020000` | 131072 | `SendMax`を超えていないのに指定された`Amount`を送金できない場合、即座に失敗とするのではなく、受取られる額を減額します。詳細は、[Partial Payments](#partial-payments)をご覧ください。 |
| `tfLimitQuality` | `0x00040000` | 262144 | すべての変換で、入力と出力との比率が`Amount``SendMax`との比率と同一であるか、さらに有利となるパスのみを採用します。詳細は、[クオリティの制限](#クオリティの制限)をご覧ください。 |
## Partial Payments
@@ -184,6 +185,10 @@ _([Credentials amendment][]が必要です。 {% not-enabled /%})_
提供された資格証明が、Deposit Authorizationを使用していないアカウントに対して提供されている場合、資格証明は不要ですが、有効性は依然としてチェックされます。
{% admonition type="info" name="注記" %}
`CredentialIDs`フィールドは、デポジットの承認処理にのみ使用され、[許可型DEX](../../../../concepts/tokens/decentralized-exchange/permissioned-dexes.md)での取引には使用されません。ただし、許可型DEXでもアクセス権限を付与するために認証情報が使用されます。許可型DEXで取引を行うには、`DomainID`フィールドを使用して、有効な資格情報を保持しているドメインを指定する必要があります。
{% /admonition %}
## 準備金を下回るアカウントに対する特別な送金のケース

View File

@@ -45,4 +45,4 @@ _([PermissionedDomains amendment][]が必要です {% not-enabled /%})_
| `tecNO_ENTRY` | `DomainID`フィールドで指定された許可型ドメインがレジャーに存在しません。 |
| `temDISABLED` | `PermissionedDomains` amendmentが有効ではありません。 |
{% raw-partial file="/docs/_snippets/common-links.md" /%}
{% raw-partial file="/@l10n/ja/docs/_snippets/common-links.md" /%}

View File

@@ -44,7 +44,7 @@ _[XChainBridge Amendment][] {% not-enabled /%} が必要です_
## XChainModifyBridgeのフィールド
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|:-------------------------|:-------------|:-------- -----|:------|-----|
|:-------------------------|:-------------|:--------------|:------|-----|
| `Flags` | 数値 | UInt32 | はい | このトランザクションのフラグを指定します。 |
| `MinAccountCreateAmount` | [通貨額][] | Amount | いいえ | `XChainAccountCreateCommit`トランザクションに必要な最小金額。このフィールドが存在しない場合、`XChainAccountCreateCommit`トランザクションは失敗します。このフィールドはXRP-XRPブリッジにのみ存在できます。 |
| `SignatureReward` | [通貨額][] | Amount | いいえ | Witnessサーバに支払う署名の報酬の合計額。この金額は署名者の間で分配されます。 |

View File

@@ -139,6 +139,10 @@ footer.community.report-a-scam: 詐欺の報告
component.tryit: 試してみる
component.queryexampletx: トランザクションの例を確認
component.amendment-status.requires.1: " "
component.amendment-status.requires.2: が必要です。
component.amendment-status.added.1: " "
component.amendment-status.added.2: により追加されました。
# Amendment tracker translations
amendment.loading: ロード中Amendments...
@@ -825,6 +829,9 @@ resources.dev-tools.websocket-api.curl.modal.desc.part2: を使用してこれ
API Methods: APIメソッド
Methods: メソッド
Examples: の例
# resources/dev-tools/websocket-api/ClioOnly.tsx
resources.dev-tools.websocket-api.clio-only-badge: Clioのみ
resources.dev-tools.websocket-api.clio-only-tooltip: このメソッドはClioサーバーからのみ利用可能です。
# resources/dev-tools/xrp-ledger-toml-checker.page.tsx
resources.dev-tools.toml-checker.p.part1: もしあなたがXRP Ledgerバリデータを運営していたり、XRP Ledgerをビジネスで利用しているのであれば、XRP Ledgerの利用状況に関する情報を、機械読み取り可能な

View File

@@ -20,7 +20,10 @@ export function IndexPageItems() {
{data?.map((item: any) => (
<li className="level-1" key={item.slug}>
<Link to={item.slug}>{item.title}</Link>
<p className='class="blurb child-blurb'>{item.blurb}</p>
{
item.status === "not_enabled" ? (<NotEnabled />) : ""
}
<p className='class="blurb child-blurb'>{item.seo?.description}</p>
</li>
))}
</ul>
@@ -380,3 +383,103 @@ function AmendmentBadge(props: { amendment: Amendment }) {
return <img src={badgeUrl} alt={status} className="shield" />;
}
export function AmendmentDisclaimer(props: {
name: string,
compact: boolean
}) {
const [amendmentStatus, setStatus] = React.useState<Amendment | null>(null);
const [loading, setLoading] = React.useState(true);
const [error, setError] = React.useState<string | null>(null);
const { useTranslate } = useThemeHooks();
const { translate } = useTranslate();
const link = () => <Link to={`/resources/known-amendments#${props.name.toLowerCase()}`}>{props.name}{ props.compact ? "" : " amendment"}</Link>
React.useEffect(() => {
const fetchAmendments = async () => {
try {
setLoading(true);
const response = await fetch(`https://vhs.prod.ripplex.io/v1/network/amendments/vote/main/`);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data: AmendmentsResponse = await response.json()
console.log("data.amendments is:", data.amendments)
let found_amendment = false
for (const amendment of data.amendments) {
if (amendment.name == props.name) {
setStatus(amendment)
found_amendment = true
break
}
}
if (!found_amendment) {
throw new Error(`Couldn't find ${props.name} amendment in status table.`)
}
} catch (err) {
setError(err instanceof Error ? err.message : 'Failed to fetch amendments');
} finally {
setLoading(false)
}
}
fetchAmendments()
}, [])
if (loading) {
return (
<p><em>
{translate("component.amendment-status.requires.1", "Requires the ")}{link()}{translate("component.amendment-status.requires.2", ".")}
{" "}
<span className="spinner-border text-primary" role="status">
<span className="sr-only">{translate("amendment.loading_status", "Loading...")}</span>
</span>
</em></p>
)
}
if (error) {
return (
<p><em>
{translate("component.amendment-status.requires.1", "Requires the ")}{link()}{translate("component.amendment-status.requires.2", ".")}
{" "}
<span className="alert alert-danger" style={{display: "block"}}>
<strong>{translate("amendment.error_status", "Error loading amendment status")}:</strong> {error}
</span>
</em></p>
)
}
if (props.compact) {
return (
<>
{link()}
{" "}
<AmendmentBadge amendment={amendmentStatus} />
</>
)
}
return (
<p><em>(
{
amendmentStatus.date ? (
<>
{translate("component.amendment-status.added.1", "Added by the ")}{link()}
{translate("component.amendment-status.added.2", ".")}
{" "}
<AmendmentBadge amendment={amendmentStatus} />
</>
) : (
<>
{translate("component.amendment-status.requires.1", "Requires the ")}{link()}
{translate("component.amendment-status.requires.2", ".")}
{" "}
<AmendmentBadge amendment={amendmentStatus} />
</>
)
}
)</em></p>
)
}

View File

@@ -221,3 +221,20 @@ export const amendmentsTable: Schema & { tagName: string } = {
render: 'AmendmentsTable',
selfClosing: true
}
export const amendmentDisclaimer: Schema & { tagName: string } = {
tagName: 'amendment-disclaimer',
attributes: {
name: {
type: 'String',
required: true
},
compact: {
type: 'Boolean',
required: false,
default: false
}
},
render: 'AmendmentDisclaimer',
selfClosing: true
}

View File

@@ -11,145 +11,155 @@ ul.nav.navbar-nav {
flex-grow: 1;
}
:root {
.clio-only-notice {
background-color: var(--admonition-info-bg-color);
margin-left: var(--spacing-sm);
padding: var(--spacing-xs);
border-radius: var(--border-radius);
}
:root, :root.dark {
--navbar-height: 80px;
/* XRPL color palette; match to styles/_colors.scss
Some colors don't have a 10 equivalent so 9 is repeated.
Note, at present these variables are mostly overridden by
styled-components variables which are in reverse order, so
we can't actually use these variables as-is.
These are in reverse order of the ones in styles/_colors.scss
so that they correspond to the same-named variables provided by
styled-components as part of Redocly.
*/
/* Redocly doesn't have vars for grays by default */
--color-gray-1: #F5F5F7;
--color-gray-2: #E0E0E1;
--color-gray-3: #C1C1C2;
--color-gray-4: #A2A2A4;
--color-gray-1: #111112;
--color-gray-2: #232325;
--color-gray-3: #343437;
--color-gray-4: #454549;
--color-gray-5: #838386;
--color-gray-6: #454549;
--color-gray-7: #343437;
--color-gray-8: #232325;
--color-gray-9: #111112;
--color-gray-6: #A2A2A4;
--color-gray-7: #C1C1C2;
--color-gray-8: #E0E0E1;
--color-gray-9: #F5F5F7;
--color-gray-10: var(--color-gray-9);
/* color-red = XRPL $magenta */
--color-red-1: #FFE5F2;
--color-red-2: #FFB2D8;
--color-red-3: #FF80BF;
--color-red-4: #FF4BA4;
--color-red-5: #FF198B;
--color-red-6: #E50071;
--color-red-7: #B20058;
--color-red-8: #80003F;
--color-red-9: #4C0026;
--color-red-10: #4C0026;
--color-red-1: #4C0026;
--color-red-2: #4C0026;
--color-red-3: #80003F;
--color-red-4: #B20058;
--color-red-5: #E50071;
--color-red-6: #FF198B;
--color-red-7: #FF4BA4;
--color-red-8: #FF80BF;
--color-red-9: #FFB2D8;
--color-red-10: #FFE5F2;
/* color-green = XRPL $green */
--color-green-1: #D6FAE7;
--color-green-2: #ADF5CE;
--color-green-3: #84F0B6;
--color-green-4: #5BEB9D;
--color-green-5: #32E685;
--color-green-6: #2DCF78;
--color-green-7: #28B86A;
--color-green-8: #1E8A50;
--color-green-9: #145C35;
--color-green-10: #0A2E1B;
--color-green-1: #0A2E1B;
--color-green-2: #145C35;
--color-green-3: #1E8A50;
--color-green-4: #28B86A;
--color-green-5: #2DCF78;
--color-green-6: #32E685;
--color-green-7: #5BEB9D;
--color-green-8: #84F0B6;
--color-green-9: #ADF5CE;
--color-green-10: #D6FAE7;
/* color-gold = XRPL $yellow */
--color-gold-1: #FEFFE5;
--color-gold-2: #FDFFB2;
--color-gold-3: #FCFF80;
--color-gold-4: #FBFF4C;
--color-gold-5: #FAFF19;
--color-gold-6: #E0E500;
--color-gold-7: #AEB200;
--color-gold-8: #7D8000;
--color-gold-9: #4B4C00;
--color-gold-10: #4B4C00;
--color-gold-1: #4B4C00;
--color-gold-2: #4B4C00;
--color-gold-3: #7D8000;
--color-gold-4: #AEB200;
--color-gold-5: #E0E500;
--color-gold-6: #FAFF19;
--color-gold-7: #FBFF4C;
--color-gold-8: #FCFF80;
--color-gold-9: #FDFFB2;
--color-gold-10: #FEFFE5;
/* color-blue = XRPL $blue */
--color-blue-1: #E5F5FF;
--color-blue-2: #B2E0FF;
--color-blue-3: #80CCFF;
--color-blue-4: #4BB7FF;
--color-blue-5: #19A3FF;
--color-blue-6: #008AE5;
--color-blue-7: #006BB2;
--color-blue-8: #004D80;
--color-blue-9: #002E4C;
--color-blue-10: #001133;
--color-blue-1: #001133;
--color-blue-2: #002E4C;
--color-blue-3: #004D80;
--color-blue-4: #006BB2;
--color-blue-5: #008AE5;
--color-blue-6: #19A3FF;
--color-blue-7: #4BB7FF;
--color-blue-8: #80CCFF;
--color-blue-9: #B2E0FF;
--color-blue-10: #E5F5FF;
/* color purple = XRPL $blue-purple */
--color-purple-1: #F0E5FF;
--color-purple-2: #D2B2FF;
--color-purple-3: #B480FF;
--color-purple-4: #9A52FF;
--color-purple-5: #7919FF;
--color-purple-6: #5F00E5;
--color-purple-7: #4A00B2;
--color-purple-8: #350080;
--color-purple-9: #20004C;
--color-purple-10: #20004C;
--color-purple-1: #20004C;
--color-purple-2: #20004C;
--color-purple-3: #350080;
--color-purple-4: #4A00B2;
--color-purple-5: #5F00E5;
--color-purple-6: #7919FF;
--color-purple-7: #9A52FF;
--color-purple-8: #B480FF;
--color-purple-9: #D2B2FF;
--color-purple-10: #F0E5FF;
/* color-magenta = XRPL $red-purple */
--color-magenta-1: #FBE5FF;
--color-magenta-2: #F2B2FF;
--color-magenta-3: #EA80FF;
--color-magenta-4: #E24CFF;
--color-magenta-5: #D919FF;
--color-magenta-6: #C000E5;
--color-magenta-7: #9500B2;
--color-magenta-8: #6B0080;
--color-magenta-9: #40004C;
--color-magenta-10: #40004C;
/* XRPL doesn't have a color-cyan equivalent
--color-cyan-1: #e6fffb;
--color-cyan-2: #b5f5ec;
--color-cyan-3: #87e8de;
--color-cyan-4: #5cdbd3;
--color-cyan-5: #36cfc9;
--color-cyan-6: #13c2c2;
--color-cyan-7: #08979c;
--color-cyan-8: #006d75;
--color-cyan-9: #00474f;
--color-cyan-10: #002329; */
--color-magenta-1: #40004C;
--color-magenta-2: #40004C;
--color-magenta-3: #6B0080;
--color-magenta-4: #9500B2;
--color-magenta-5: #C000E5;
--color-magenta-6: #D919FF;
--color-magenta-7: #E24CFF;
--color-magenta-8: #EA80FF;
--color-magenta-9: #F2B2FF;
--color-magenta-10: #FBE5FF;
/* XRPL doesn't have a color-cyan equivalent*
--color-cyan-1: #002329;*
--color-cyan-2: #00474f;*
--color-cyan-3: #006d75;*
--color-cyan-4: #08979c;*
--color-cyan-5: #13c2c2;*
--color-cyan-6: #36cfc9;*
--color-cyan-7: #5cdbd3;*
--color-cyan-8: #87e8de;*
--color-cyan-9: #b5f5ec;*
--color-cyan-10: #e6fffb; */
/* color-yellow = XRPL $yellow */
--color-yellow-1: #FEFFE5;
--color-yellow-2: #FDFFB2;
--color-yellow-3: #FCFF80;
--color-yellow-4: #FBFF4C;
--color-yellow-5: #FAFF19;
--color-yellow-6: #E0E500;
--color-yellow-7: #AEB200;
--color-yellow-8: #7D8000;
--color-yellow-9: #4B4C00;
--color-yellow-10: #4B4C00;
/* XRPL doesn't have a color-lime equivalent
--color-lime-1: #fcffe6;
--color-lime-2: #f4ffb8;
--color-lime-3: #eaff8f;
--color-lime-4: #d3f261;
--color-lime-5: #bae637;
--color-lime-6: #a0d911;
--color-lime-7: #7cb305;
--color-lime-8: #5b8c00;
--color-lime-9: #3f6600;
--color-lime-10: #254000; */
/* XRPL doesn't have a color-geekblue equivalent
--color-geekblue-1: #f0f5ff;
--color-geekblue-2: #d6e4ff;
--color-geekblue-3: #adc6ff;
--color-geekblue-4: #85a5ff;
--color-geekblue-5: #597ef7;
--color-geekblue-6: #2f54eb;
--color-geekblue-7: #1d39c4;
--color-geekblue-8: #10239e;
--color-geekblue-9: #061178;
--color-geekblue-10: #030852; */
--color-yellow-1: #4B4C00;
--color-yellow-2: #4B4C00;
--color-yellow-3: #7D8000;
--color-yellow-4: #AEB200;
--color-yellow-5: #E0E500;
--color-yellow-6: #FAFF19;
--color-yellow-7: #FBFF4C;
--color-yellow-8: #FCFF80;
--color-yellow-9: #FDFFB2;
--color-yellow-10: #FEFFE5;
/* XRPL doesn't have a color-lime equivalent*
--color-lime-1: #254000;*
--color-lime-2: #3f6600;*
--color-lime-3: #5b8c00;*
--color-lime-4: #7cb305;*
--color-lime-5: #a0d911;*
--color-lime-6: #bae637;*
--color-lime-7: #d3f261;*
--color-lime-8: #eaff8f;*
--color-lime-9: #f4ffb8;*
--color-lime-10: #fcffe6; */
/* XRPL doesn't have a color-geekblue equivalent*
--color-geekblue-1: #030852;*
--color-geekblue-2: #061178;*
--color-geekblue-3: #10239e;*
--color-geekblue-4: #1d39c4;*
--color-geekblue-5: #2f54eb;*
--color-geekblue-6: #597ef7;*
--color-geekblue-7: #85a5ff;*
--color-geekblue-8: #adc6ff;*
--color-geekblue-9: #d6e4ff;*
--color-geekblue-10: #f0f5ff; */
/* Dark mode colors by default */
--color-primary-bg: var(--color-gray-10);
@@ -162,30 +172,30 @@ ul.nav.navbar-nav {
--color-primary-text-hover: #201dad;
--color-primary-text: #161087;
--color-primary-text-active: #0d086e;*/
--link-color-primary: #fff;
--link-color-primary: white;
--link-decoration: underline;
--link-font-weight: var(--font-weight-regular);
--link-color-primary-hover: #9a52ff;
--link-color-primary-hover: var(--color-purple-7)
--link-decoration-hover: underline;
--link-color-visited: #fff;
--link-color-visited: white;
--link-visited-decoration: underline;
--bg-color: var(--color-gray-10);
--bg-color-raised: var(--color-gray-8);
--bg-color-raised: var(--color-gray-2);
--background-color: var(--bg-color);
--font-family-base: 'Work Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
--heading-font-family: var(--font-family-base);
--inline-code-font-family: "Space Mono", monospace;
--inline-code-text-color: #5beb9d; /* $green-400 */
--inline-code-bg-color: #0a2e1b; /* $green-1000 */
--inline-code-text-color: var(--color-green-7);
--inline-code-bg-color: var(--color-green-1);
--inline-code-border-radius: 0;
--heading-anchor-color: #9a52ff;
--heading-anchor-color: var(--color-purple-7);
--h1-font-size: 3rem;
--h2-font-size: 2.5rem;
--h3-font-size: 2.125rem;
@@ -195,14 +205,18 @@ ul.nav.navbar-nav {
--h5-font-size: 1.25rem;
--h5-line-height: 1.5rem;
--menu-container-padding-top: 0;
--md-content-padding: 4px 0;
--toc-offset-top: 2px;
--sidebar-border-color: transparent;
--sidebar-bg-color: transparent;
--sidebar-margin-horizontal: 32px;
--border-radius-md: 4px;
--code-block-bg-color: #232325;
--code-block-controls-bg-color: #232325;
--code-block-bg-color: var(--color-gray-2);
--code-block-controls-bg-color: var(--color-gray-2);
--code-block-controls-border: none;
--code-block-padding: 0 2rem 1.5rem 2rem;
@@ -216,62 +230,111 @@ ul.nav.navbar-nav {
--footer-border-color: transparent;
--footer-title-font-weight: 600;
--footer-title-font-size: 1rem;
--footer-title-text-color: #A2A2A4;
--footer-title-text-color: var(--color-gray-6);
--menu-item-padding-horizontal: 0px;
--md-list-left-padding: 40px;
--md-table-header-bg-color: #32343E;
--md-table-border-color: #32343E;
--md-list-margin: 0 0 20px 0;
--md-table-header-bg-color: var(--color-gray-3);
--md-table-border-color: var(--color-gray-3);
--md-tabs-content-padding: 0;
--md-tabs-tab-wrapper-padding: 0;
--text-color-helper: var(--color-gray-6);
--color-text-primary: white;
--button-color-hover: white;
--text-color-secondary: var(--color-gray-9); /* inherited for adominition text color */
--admonition-success-bg-color: var(--color-green-2);
--admonition-info-bg-color: var(--color-blue-4);
/* none of the yellow shades in the XRPL palette work well with "warning"
admonitions, so leave it the default */
--admonition-danger-bg-color: var(--color-red-3);
}
:root.light {
--link-color-primary-hover: #4A00B2;
--link-color-visited: #000;
--text-color-secondary: #000;
--code-block-bg-color: #E0E0E1;
--code-block-controls-bg-color: #E0E0E1;
--link-color-primary-hover: var(--color-purple-4);
--link-color-visited: black;
--text-color-secondary: black;
--code-block-bg-color: var(--color-gray-8);
--code-block-controls-bg-color: var(--color-gray-8);
--code-block-controls-border: none;
--md-tabs-active-tab-bg-color: #C1C1C2;
--code-block-tokens-function-color: #B23C00;
--code-block-tokens-operator-color: #000;
--code-block-tokens-comment-color: #343437;
--code-block-tokens-string-color: #145C35;
--inline-code-bg-color: #E0E0E1;
--md-tabs-active-tab-bg-color: var(--color-gray-7);
--search-trigger-bg-color: #E0E0E1;
--search-trigger-color: #838386;
--inline-code-bg-color: var(--color-gray-8);
--language-picker-border-color: #C1C1C2;
--language-picker-background-color: #E0E0E1;
--select-list-bg-color: #E0E0E1;
--search-trigger-bg-color: var(--color-gray-8);
--search-trigger-color: var(--color-gray-5);
--modal-bg-color: var(--color-gray-9);
--footer-title-text-color: #000;
--bg-color: var(--color-gray-1);
--bg-color-raised: var(--color-gray-2);
--button-content-color-link: #000;
--language-picker-border-color: var(--color-gray-7);
--language-picker-background-color: var(--color-gray-8);
--select-list-bg-color: var(--color-gray-8);
--md-table-header-bg-color: var(--color-gray-2);
--md-table-border-color: var(--color-gray-2);
--footer-title-text-color: black;
--bg-color: var(--color-gray-9);
--bg-color-raised: var(--color-gray-8);
--button-content-color-link: black;
--md-table-header-bg-color: var(--color-gray-8);
--md-table-border-color: var(--color-gray-8);
--bg-color: var(--color-gray-8);
--code-panel-bg-color: var(--color-blue-7);
--layer-color-hover: var(--color-gray-9);
--code-block-text-color: var(--color-gray-1);
--code-block-tokens-comment-color: var(--color-gray-4);
--code-block-tokens-constant-color: var(--color-gray-1);
--code-block-tokens-function-color: var(--color-red-4);
--code-block-tokens-keyword-color: var(--color-magenta-5);
--code-block-tokens-operator-color: black;
--code-block-tokens-string-color: var(--color-green-3);
--bg-raised-gradient: "";
--text-color-helper: var(--color-gray-4);
--button-color-hover: black;
--admonition-success-bg-color: var(--color-green-9);
--admonition-info-bg-color: var(--color-blue-9);
--admonition-warning-bg-color: var(--color-yellow-9);
--admonition-danger-bg-color: var(--color-red-9);
}
:root.dark {
--link-color-primary: #fff;
--link-color-visited: #fff;
--link-color-primary-hover: #9a52ff;
--search-highlight-text-color: #4BB7FF; /* color-blue-4 */
--code-block-tokens-comment-color: #C1C1C2; /* color-gray-3 */
--link-color-primary: white;
--link-color-visited: white;
--link-color-primary-hover: var(--color-purple-7);
--navbar-bg-color: var(--color-gray-2); /* controls search box bg */
--modal-bg-color: var(--color-gray-2); /* controls search modal bg */
--search-highlight-text-color: var(--color-blue-7);
--code-block-text-color: var(--color-gray-9);
--code-block-tokens-comment-color: var(--color-gray-7);
--code-block-tokens-constant-color: var(--color-gray-9);
--code-block-tokens-keyword-color: var(--color-magenta-8);
--code-block-tokens-string-color: var(--color-blue-8);
--code-panel-bg-color: var(--color-blue-3);
--layer-color-hover: var(--color-gray-3);
--bg-raised-gradient: "";
}
:root .form-control-plaintext {
color: var(--text-color);
}
/* Fix unnecessary horizontal scrolling of tables in Japanese */
[lang="ja"] table.md {
word-break: break-word;
}
[lang="ja"] table.md th {
min-width: 7em;
}
[data-component-name="Search/SearchTrigger"] > div {
justify-content: start;
width: 100%;

View File

@@ -0,0 +1,253 @@
{
"result": {
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"account_objects": [
{
"Balance": {
"currency": "ASP",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "0"
},
"Flags": 65536,
"HighLimit": {
"currency": "ASP",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "0"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "ASP",
"issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
"value": "10"
},
"LowNode": "0",
"PreviousTxnID": "BF7555B0F018E3C5E2A3FF9437A1A5092F32903BE246202F988181B9CED0D862",
"PreviousTxnLgrSeq": 1438879,
"index": "2243B0B630EA6F7330B654EFA53E27A7609D9484E535AB11B7F946DF3D247CE9"
},
{
"Balance": {
"currency": "JOE",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "0"
},
"Flags": 2228224,
"HighLimit": {
"currency": "JOE",
"issuer": "rE6R3DWF9fBD7CyiQciePF9SqK58Ubp8o2",
"value": "100"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "JOE",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "0"
},
"LowNode": "0",
"PreviousTxnID": "8E488B0E939D4DACD62102A5BFA2FDC63679EFCC56F2FDA2FDF45283674BB711",
"PreviousTxnLgrSeq": 5989200,
"index": "273BD42DD72E7D84416ED759CEC92DACCD12A4502287E50BECF816233C021ED1"
},
{
"Balance": {
"currency": "USD",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "0"
},
"Flags": 131072,
"HighLimit": {
"currency": "USD",
"issuer": "rEhDDUUNxpXgEHVJtC2cjXAgyx5VCFxdMF",
"value": "1"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "USD",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "0"
},
"LowNode": "0",
"PreviousTxnID": "B6B410172C0B65575D89E464AF5B99937CC568822929ABF87DA75CBD11911932",
"PreviousTxnLgrSeq": 6592159,
"index": "2CC2B211F6D1159B5CFD07AF8717A9C51C985E2497B2875C192EE87266AB0F81"
},
{
"Balance": {
"currency": "USD",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "5"
},
"Flags": 1114112,
"HighLimit": {
"currency": "USD",
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"value": "0"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "USD",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "5"
},
"LowNode": "0",
"PreviousTxnID": "2A5C5D95880A254A2C57BB5332558205BC33B9F2B38D359A170283CB4CBD080A",
"PreviousTxnLgrSeq": 39498567,
"index": "2DECFAC23B77D5AEA6116C15F5C6D4669EBAEE9E7EE050A40FE2B1E47B6A9419"
},
{
"Balance": {
"currency": "EUR",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "0.793598266778297"
},
"Flags": 1114112,
"HighLimit": {
"currency": "EUR",
"issuer": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
"value": "0"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "EUR",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "1"
},
"LowNode": "0",
"PreviousTxnID": "E9345D44433EA368CFE1E00D84809C8E695C87FED18859248E13662D46A0EC46",
"PreviousTxnLgrSeq": 5447146,
"index": "4513749B30F4AF8DA11F077C448128D6486BF12854B760E4E5808714588AA915"
},
{
"Balance": {
"currency": "CNY",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "0"
},
"Flags": 2228224,
"HighLimit": {
"currency": "CNY",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "3"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "CNY",
"issuer": "rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK",
"value": "0"
},
"LowNode": "8",
"PreviousTxnID": "2FDDC81F4394695B01A47913BEC4281AC9A283CC8F903C14ADEA970F60E57FCF",
"PreviousTxnLgrSeq": 5949673,
"index": "578C327DA8944BDE2E10C9BA36AFA2F43E06C8D1E8819FB225D266CBBCFDE5CE"
},
{
"Balance": {
"currency": "DYM",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "1.336889190631542"
},
"Flags": 65536,
"HighLimit": {
"currency": "DYM",
"issuer": "rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E",
"value": "0"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "DYM",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "3"
},
"LowNode": "0",
"PreviousTxnID": "6DA2BD02DFB83FA4DAFC2651860B60071156171E9C021D9E0372A61A477FFBB1",
"PreviousTxnLgrSeq": 8818732,
"index": "5A2A5FF12E71AEE57564E624117BBA68DEF78CD564EF6259F92A011693E027C7"
},
{
"Balance": {
"currency": "BTC",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "0"
},
"Flags": 131072,
"HighLimit": {
"currency": "BTC",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "3"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "BTC",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value": "0"
},
"LowNode": "43",
"PreviousTxnID": "03EDF724397D2DEE70E49D512AECD619E9EA536BE6CFD48ED167AE2596055C9A",
"PreviousTxnLgrSeq": 8317037,
"index": "767C12AF647CDF5FEB9019B37018748A79C50EDAF87E8D4C7F39F78AA7CA9765"
},
{
"Balance": {
"currency": "USD",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "-11.68225001668339"
},
"Flags": 131072,
"HighLimit": {
"currency": "USD",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "5000"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "USD",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value": "0"
},
"LowNode": "4a",
"PreviousTxnID": "8C55AFC2A2AA42B5CE624AEECDB3ACFDD1E5379D4E5BF74A8460C5E97EF8706B",
"PreviousTxnLgrSeq": 43251698,
"index": "826CF5BFD28F3934B518D0BDF3231259CBD3FD0946E3C3CA0C97D2C75D2D1A09"
},
{
"Balance": {
"currency": "USD",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "0"
},
"Flags": 2228224,
"HighLimit": {
"currency": "USD",
"issuer": "rE6R3DWF9fBD7CyiQciePF9SqK58Ubp8o2",
"value": "100"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "USD",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "0"
},
"LowNode": "0",
"PreviousTxnID": "B1A7405C4A698E6A371E5B02836E779A942936AB754865FE82141E5280F09D1B",
"PreviousTxnLgrSeq": 5718137,
"index": "8DF1456AAB7470A760F6A095C156B457FF1038D43E6B11FD8011C2DF714E4FA1"
}
],
"ledger_hash": "E471A081996BB5CBB666AC99085CB8E3CA4D59DFCEDC0060B8701DC45A0EE423",
"ledger_index": 98162290,
"limit": 10,
"marker": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93,94A9F05FEF9A153229E2E997E64919FD75AAE2028C8153E8EBDB4440BD3ECBB5",
"status": "success",
"validated": true
}
}

View File

@@ -0,0 +1,256 @@
{
"id": "example_account_objects",
"result": {
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"account_objects": [
{
"Balance": {
"currency": "ASP",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "0"
},
"Flags": 65536,
"HighLimit": {
"currency": "ASP",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "0"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "ASP",
"issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
"value": "10"
},
"LowNode": "0",
"PreviousTxnID": "BF7555B0F018E3C5E2A3FF9437A1A5092F32903BE246202F988181B9CED0D862",
"PreviousTxnLgrSeq": 1438879,
"index": "2243B0B630EA6F7330B654EFA53E27A7609D9484E535AB11B7F946DF3D247CE9"
},
{
"Balance": {
"currency": "JOE",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "0"
},
"Flags": 2228224,
"HighLimit": {
"currency": "JOE",
"issuer": "rE6R3DWF9fBD7CyiQciePF9SqK58Ubp8o2",
"value": "100"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "JOE",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "0"
},
"LowNode": "0",
"PreviousTxnID": "8E488B0E939D4DACD62102A5BFA2FDC63679EFCC56F2FDA2FDF45283674BB711",
"PreviousTxnLgrSeq": 5989200,
"index": "273BD42DD72E7D84416ED759CEC92DACCD12A4502287E50BECF816233C021ED1"
},
{
"Balance": {
"currency": "USD",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "0"
},
"Flags": 131072,
"HighLimit": {
"currency": "USD",
"issuer": "rEhDDUUNxpXgEHVJtC2cjXAgyx5VCFxdMF",
"value": "1"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "USD",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "0"
},
"LowNode": "0",
"PreviousTxnID": "B6B410172C0B65575D89E464AF5B99937CC568822929ABF87DA75CBD11911932",
"PreviousTxnLgrSeq": 6592159,
"index": "2CC2B211F6D1159B5CFD07AF8717A9C51C985E2497B2875C192EE87266AB0F81"
},
{
"Balance": {
"currency": "USD",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "5"
},
"Flags": 1114112,
"HighLimit": {
"currency": "USD",
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"value": "0"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "USD",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "5"
},
"LowNode": "0",
"PreviousTxnID": "2A5C5D95880A254A2C57BB5332558205BC33B9F2B38D359A170283CB4CBD080A",
"PreviousTxnLgrSeq": 39498567,
"index": "2DECFAC23B77D5AEA6116C15F5C6D4669EBAEE9E7EE050A40FE2B1E47B6A9419"
},
{
"Balance": {
"currency": "EUR",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "0.793598266778297"
},
"Flags": 1114112,
"HighLimit": {
"currency": "EUR",
"issuer": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
"value": "0"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "EUR",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "1"
},
"LowNode": "0",
"PreviousTxnID": "E9345D44433EA368CFE1E00D84809C8E695C87FED18859248E13662D46A0EC46",
"PreviousTxnLgrSeq": 5447146,
"index": "4513749B30F4AF8DA11F077C448128D6486BF12854B760E4E5808714588AA915"
},
{
"Balance": {
"currency": "CNY",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "0"
},
"Flags": 2228224,
"HighLimit": {
"currency": "CNY",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "3"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "CNY",
"issuer": "rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK",
"value": "0"
},
"LowNode": "8",
"PreviousTxnID": "2FDDC81F4394695B01A47913BEC4281AC9A283CC8F903C14ADEA970F60E57FCF",
"PreviousTxnLgrSeq": 5949673,
"index": "578C327DA8944BDE2E10C9BA36AFA2F43E06C8D1E8819FB225D266CBBCFDE5CE"
},
{
"Balance": {
"currency": "DYM",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "1.336889190631542"
},
"Flags": 65536,
"HighLimit": {
"currency": "DYM",
"issuer": "rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E",
"value": "0"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "DYM",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "3"
},
"LowNode": "0",
"PreviousTxnID": "6DA2BD02DFB83FA4DAFC2651860B60071156171E9C021D9E0372A61A477FFBB1",
"PreviousTxnLgrSeq": 8818732,
"index": "5A2A5FF12E71AEE57564E624117BBA68DEF78CD564EF6259F92A011693E027C7"
},
{
"Balance": {
"currency": "BTC",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "0"
},
"Flags": 131072,
"HighLimit": {
"currency": "BTC",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "3"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "BTC",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value": "0"
},
"LowNode": "43",
"PreviousTxnID": "03EDF724397D2DEE70E49D512AECD619E9EA536BE6CFD48ED167AE2596055C9A",
"PreviousTxnLgrSeq": 8317037,
"index": "767C12AF647CDF5FEB9019B37018748A79C50EDAF87E8D4C7F39F78AA7CA9765"
},
{
"Balance": {
"currency": "USD",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "-11.68225001668339"
},
"Flags": 131072,
"HighLimit": {
"currency": "USD",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "5000"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "USD",
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"value": "0"
},
"LowNode": "4a",
"PreviousTxnID": "8C55AFC2A2AA42B5CE624AEECDB3ACFDD1E5379D4E5BF74A8460C5E97EF8706B",
"PreviousTxnLgrSeq": 43251698,
"index": "826CF5BFD28F3934B518D0BDF3231259CBD3FD0946E3C3CA0C97D2C75D2D1A09"
},
{
"Balance": {
"currency": "USD",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
"value": "0"
},
"Flags": 2228224,
"HighLimit": {
"currency": "USD",
"issuer": "rE6R3DWF9fBD7CyiQciePF9SqK58Ubp8o2",
"value": "100"
},
"HighNode": "0",
"LedgerEntryType": "RippleState",
"LowLimit": {
"currency": "USD",
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"value": "0"
},
"LowNode": "0",
"PreviousTxnID": "B1A7405C4A698E6A371E5B02836E779A942936AB754865FE82141E5280F09D1B",
"PreviousTxnLgrSeq": 5718137,
"index": "8DF1456AAB7470A760F6A095C156B457FF1038D43E6B11FD8011C2DF714E4FA1"
}
],
"ledger_hash": "59D7E38286AD80C402EC1533BFE002285E792698EEFA06BD3D5AEAC618B56B0A",
"ledger_index": 98162008,
"limit": 10,
"marker": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93,94A9F05FEF9A153229E2E997E64919FD75AAE2028C8153E8EBDB4440BD3ECBB5|NONFH",
"validated": true,
"_nodepref": "nonfh"
},
"status": "success",
"type": "response"
}

View File

@@ -0,0 +1,4 @@
# Batch
Code samples showing how to create and submit a [Batch transaction](../../docs/concepts/transactions/batch-transactions.md).
Both for simple and multi account batch transactions.

View File

@@ -0,0 +1,24 @@
module github.com/XRPLF
go 1.23.0
toolchain go1.23.10
require github.com/Peersyst/xrpl-go v0.1.11
require (
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/tyler-smith/go-bip32 v1.0.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/crypto v0.35.0 // indirect
)

View File

@@ -0,0 +1,58 @@
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e h1:ahyvB3q25YnZWly5Gq1ekg6jcmWaGj/vG/MhF4aisoc=
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:kGUqhHd//musdITWjFvNTHn90WG9bMLBEPQZ17Cmlpw=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec h1:1Qb69mGp/UtRPn422BH4/Y4Q3SLUrD9KHuDkm8iodFc=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec/go.mod h1:CD8UlnlLDiqb36L110uqiP2iSflVjx9g/3U9hCI4q2U=
github.com/Peersyst/xrpl-go v0.1.11 h1:P6r/gHxRnbAtAdPmzNHz/7zpsdfvwh0SS+QI2JNT44w=
github.com/Peersyst/xrpl-go v0.1.11/go.mod h1:CBRM3/soqNeeL2Jx6USVUtECqulZVUoq3UxZKMz9hdw=
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 h1:TvGTmUBHDU75OHro9ojPLK+Yv7gDl2hnUvRocRCjsys=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2/go.mod h1:uGfjDyePSpa75cSQLzNdVmWlbQMBuiJkvXw/MNKRY4M=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.1.5-0.20170601210322-f6abca593680/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tyler-smith/go-bip32 v1.0.0 h1:sDR9juArbUgX+bO/iblgZnMPeWY1KZMUC2AFUJdv5KE=
github.com/tyler-smith/go-bip32 v1.0.0/go.mod h1:onot+eHknzV4BVPwrzqY5OoVpyCvnwD7lMawL5aQupE=
github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM=

View File

@@ -0,0 +1,198 @@
package main
import (
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
"github.com/Peersyst/xrpl-go/xrpl/rpc"
"github.com/Peersyst/xrpl-go/xrpl/rpc/types"
"github.com/Peersyst/xrpl-go/xrpl/transaction"
txnTypes "github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
)
var (
CreatePaymentTx = func(sender, receiver *wallet.Wallet, amount txnTypes.CurrencyAmount) *transaction.Payment {
return &transaction.Payment{
BaseTx: transaction.BaseTx{
Account: sender.GetAddress(),
TransactionType: transaction.PaymentTx,
Flags: txnTypes.TfInnerBatchTxn,
},
Amount: amount,
Destination: receiver.GetAddress(),
}
}
)
func main() {
// Configure the client
cfg, err := rpc.NewClientConfig(
"https://s.devnet.rippletest.net:51234/",
rpc.WithFaucetProvider(faucet.NewDevnetFaucetProvider()),
)
if err != nil {
panic(err)
}
client := rpc.NewClient(cfg)
// Create and fund wallets
userWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
user2Wallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
receiverWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
fmt.Println("Funding wallets...")
if err := client.FundWallet(&userWallet); err != nil {
panic(err)
}
if err := client.FundWallet(&user2Wallet); err != nil {
panic(err)
}
fmt.Println("Wallets funded")
// Check initial balances
userBalance, err := client.GetXrpBalance(userWallet.ClassicAddress)
if err != nil {
userBalance = "0"
}
user2Balance, err := client.GetXrpBalance(user2Wallet.ClassicAddress)
if err != nil {
user2Balance = "0"
}
receiverBalance, err := client.GetXrpBalance(receiverWallet.ClassicAddress)
if err != nil {
receiverBalance = "0"
}
fmt.Printf("User initial balance: %s XRP\n", userBalance)
fmt.Printf("User2 initial balance: %s XRP\n", user2Balance)
fmt.Printf("Receiver initial balance: %s XRP\n", receiverBalance)
fmt.Println()
fmt.Printf("Batch transaction test\n")
// Create test batch transaction
batchTx := &transaction.Batch{
BaseTx: transaction.BaseTx{
Account: txnTypes.Address(userWallet.ClassicAddress),
TransactionType: transaction.BatchTx,
},
RawTransactions: []txnTypes.RawTransaction{
{RawTransaction: CreatePaymentTx(&userWallet, &receiverWallet, txnTypes.XRPCurrencyAmount(5000000)).Flatten()},
{RawTransaction: CreatePaymentTx(&userWallet, &receiverWallet, txnTypes.XRPCurrencyAmount(5000000)).Flatten()},
},
}
batchTx.SetAllOrNothingFlag()
flattenedBatchTx := batchTx.Flatten()
fmt.Println("Autofilling flattened batch transaction...")
if err := client.Autofill(&flattenedBatchTx); err != nil {
panic(err)
}
fmt.Println("Signing batch transaction...")
response, err := client.SubmitTxAndWait(flattenedBatchTx, &types.SubmitOptions{
Autofill: false,
Wallet: &userWallet,
})
if err != nil {
panic(err)
}
fmt.Println("Batch transaction submitted")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Printf("Validated: %t\n", response.Validated)
fmt.Println()
// Check final balances
finalUserBalance, err := client.GetXrpBalance(userWallet.ClassicAddress)
if err != nil {
finalUserBalance = "0"
}
finalReceiverBalance, err := client.GetXrpBalance(receiverWallet.ClassicAddress)
if err != nil {
finalReceiverBalance = "0"
}
fmt.Printf("User final balance: %s XRP\n", finalUserBalance)
fmt.Printf("Receiver final balance: %s XRP\n", finalReceiverBalance)
fmt.Println()
fmt.Printf("Multisig Batch transaction test\n")
// Create test batch transaction
multiBatchTx := &transaction.Batch{
BaseTx: transaction.BaseTx{
Account: txnTypes.Address(userWallet.ClassicAddress),
TransactionType: transaction.BatchTx,
},
RawTransactions: []txnTypes.RawTransaction{
{RawTransaction: CreatePaymentTx(&userWallet, &receiverWallet, txnTypes.XRPCurrencyAmount(5000000)).Flatten()},
{RawTransaction: CreatePaymentTx(&user2Wallet, &receiverWallet, txnTypes.XRPCurrencyAmount(5000000)).Flatten()},
},
BatchSigners: []txnTypes.BatchSigner{
{
BatchSigner: txnTypes.BatchSignerData{
Account: txnTypes.Address(user2Wallet.ClassicAddress),
SigningPubKey: user2Wallet.PublicKey,
},
},
},
}
multiBatchTx.SetAllOrNothingFlag()
flattenedMultiBatchTx := multiBatchTx.Flatten()
fmt.Println("Autofilling flattened multi batch transaction...")
if err := client.AutofillMultisigned(&flattenedMultiBatchTx, 1); err != nil {
panic(err)
}
fmt.Println("Signing multi batch transaction...")
if err := wallet.SignMultiBatch(user2Wallet, &flattenedMultiBatchTx, nil); err != nil {
panic(err)
}
response, err = client.SubmitTxAndWait(flattenedMultiBatchTx, &types.SubmitOptions{
Autofill: false,
Wallet: &userWallet,
})
if err != nil {
panic(err)
}
fmt.Println("Multisig Batch transaction submitted")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Printf("Validated: %t\n", response.Validated)
fmt.Println()
// Check final balances
finalUser2Balance, err := client.GetXrpBalance(user2Wallet.ClassicAddress)
if err != nil {
finalUser2Balance = "0"
}
finalUserBalance, err = client.GetXrpBalance(userWallet.ClassicAddress)
if err != nil {
finalUserBalance = "0"
}
finalReceiverBalance, err = client.GetXrpBalance(receiverWallet.ClassicAddress)
if err != nil {
finalReceiverBalance = "0"
}
fmt.Printf("User final balance: %s XRP\n", finalUserBalance)
fmt.Printf("User2 final balance: %s XRP\n", finalUser2Balance)
fmt.Printf("Receiver final balance: %s XRP\n", finalReceiverBalance)
}

View File

@@ -0,0 +1,199 @@
package main
import (
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
"github.com/Peersyst/xrpl-go/xrpl/transaction"
txnTypes "github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
"github.com/Peersyst/xrpl-go/xrpl/websocket"
"github.com/Peersyst/xrpl-go/xrpl/websocket/types"
)
var (
CreatePaymentTx = func(sender, receiver *wallet.Wallet, amount txnTypes.CurrencyAmount) *transaction.Payment {
return &transaction.Payment{
BaseTx: transaction.BaseTx{
Account: sender.GetAddress(),
TransactionType: transaction.PaymentTx,
Flags: txnTypes.TfInnerBatchTxn,
},
Amount: amount,
Destination: receiver.GetAddress(),
}
}
)
func main() {
// Connect to testnet
client := websocket.NewClient(
websocket.NewClientConfig().
WithHost("wss://s.devnet.rippletest.net:51233").
WithFaucetProvider(faucet.NewDevnetFaucetProvider()),
)
defer client.Disconnect()
if err := client.Connect(); err != nil {
panic(err)
}
// Create and fund wallets
userWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
user2Wallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
receiverWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
fmt.Println("Funding wallets...")
if err := client.FundWallet(&userWallet); err != nil {
panic(err)
}
if err := client.FundWallet(&user2Wallet); err != nil {
panic(err)
}
fmt.Println("Wallets funded")
// Check initial balances
userBalance, err := client.GetXrpBalance(userWallet.ClassicAddress)
if err != nil {
userBalance = "0"
}
user2Balance, err := client.GetXrpBalance(user2Wallet.ClassicAddress)
if err != nil {
user2Balance = "0"
}
receiverBalance, err := client.GetXrpBalance(receiverWallet.ClassicAddress)
if err != nil {
receiverBalance = "0"
}
fmt.Printf("User initial balance: %s XRP\n", userBalance)
fmt.Printf("User2 initial balance: %s XRP\n", user2Balance)
fmt.Printf("Receiver initial balance: %s XRP\n", receiverBalance)
fmt.Println()
fmt.Printf("Batch transaction test\n")
// Create test batch transaction
batchTx := &transaction.Batch{
BaseTx: transaction.BaseTx{
Account: txnTypes.Address(userWallet.ClassicAddress),
TransactionType: transaction.BatchTx,
},
RawTransactions: []txnTypes.RawTransaction{
{RawTransaction: CreatePaymentTx(&userWallet, &receiverWallet, txnTypes.XRPCurrencyAmount(5000000)).Flatten()},
{RawTransaction: CreatePaymentTx(&userWallet, &receiverWallet, txnTypes.XRPCurrencyAmount(5000000)).Flatten()},
},
}
batchTx.SetAllOrNothingFlag()
flattenedBatchTx := batchTx.Flatten()
fmt.Println("Autofilling flattened batch transaction...")
if err := client.Autofill(&flattenedBatchTx); err != nil {
panic(err)
}
fmt.Println("Signing batch transaction...")
response, err := client.SubmitTxAndWait(flattenedBatchTx, &types.SubmitOptions{
Autofill: false,
Wallet: &userWallet,
})
if err != nil {
panic(err)
}
fmt.Println("Batch transaction submitted")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Printf("Validated: %t\n", response.Validated)
fmt.Println()
// Check final balances
finalUserBalance, err := client.GetXrpBalance(userWallet.ClassicAddress)
if err != nil {
finalUserBalance = "0"
}
finalReceiverBalance, err := client.GetXrpBalance(receiverWallet.ClassicAddress)
if err != nil {
finalReceiverBalance = "0"
}
fmt.Printf("User final balance: %s XRP\n", finalUserBalance)
fmt.Printf("Receiver final balance: %s XRP\n", finalReceiverBalance)
fmt.Println()
fmt.Printf("Multisig Batch transaction test\n")
// Create test batch transaction
multiBatchTx := &transaction.Batch{
BaseTx: transaction.BaseTx{
Account: txnTypes.Address(userWallet.ClassicAddress),
TransactionType: transaction.BatchTx,
},
RawTransactions: []txnTypes.RawTransaction{
{RawTransaction: CreatePaymentTx(&userWallet, &receiverWallet, txnTypes.XRPCurrencyAmount(5000000)).Flatten()},
{RawTransaction: CreatePaymentTx(&user2Wallet, &receiverWallet, txnTypes.XRPCurrencyAmount(5000000)).Flatten()},
},
BatchSigners: []txnTypes.BatchSigner{
{
BatchSigner: txnTypes.BatchSignerData{
Account: txnTypes.Address(user2Wallet.ClassicAddress),
SigningPubKey: user2Wallet.PublicKey,
},
},
},
}
multiBatchTx.SetAllOrNothingFlag()
flattenedMultiBatchTx := multiBatchTx.Flatten()
fmt.Println("Autofilling flattened multi batch transaction...")
if err := client.AutofillMultisigned(&flattenedMultiBatchTx, 1); err != nil {
panic(err)
}
fmt.Println("Signing multi batch transaction...")
if err := wallet.SignMultiBatch(user2Wallet, &flattenedMultiBatchTx, nil); err != nil {
panic(err)
}
response, err = client.SubmitTxAndWait(flattenedMultiBatchTx, &types.SubmitOptions{
Autofill: false,
Wallet: &userWallet,
})
if err != nil {
panic(err)
}
fmt.Println("Multisig Batch transaction submitted")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Printf("Validated: %t\n", response.Validated)
fmt.Println()
// Check final balances
finalUser2Balance, err := client.GetXrpBalance(user2Wallet.ClassicAddress)
if err != nil {
finalUser2Balance = "0"
}
finalUserBalance, err = client.GetXrpBalance(userWallet.ClassicAddress)
if err != nil {
finalUserBalance = "0"
}
finalReceiverBalance, err = client.GetXrpBalance(receiverWallet.ClassicAddress)
if err != nil {
finalReceiverBalance = "0"
}
fmt.Printf("User final balance: %s XRP\n", finalUserBalance)
fmt.Printf("User2 final balance: %s XRP\n", finalUser2Balance)
fmt.Printf("Receiver final balance: %s XRP\n", finalReceiverBalance)
}

View File

@@ -830,12 +830,13 @@ set-function-length@^1.2.2:
has-property-descriptors "^1.0.2"
sha.js@^2.4.0, sha.js@^2.4.11, sha.js@^2.4.8:
version "2.4.11"
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7"
integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==
version "2.4.12"
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.12.tgz#eb8b568bf383dfd1867a32c3f2b74eb52bdbf23f"
integrity sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==
dependencies:
inherits "^2.0.1"
safe-buffer "^5.0.1"
inherits "^2.0.4"
safe-buffer "^5.2.1"
to-buffer "^1.2.0"
source-map-js@^1.2.1:
version "1.2.1"

View File

@@ -0,0 +1,24 @@
module github.com/XRPLF
go 1.23.0
toolchain go1.23.10
require github.com/Peersyst/xrpl-go v0.1.11
require (
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/tyler-smith/go-bip32 v1.0.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/crypto v0.35.0 // indirect
)

View File

@@ -0,0 +1,58 @@
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e h1:ahyvB3q25YnZWly5Gq1ekg6jcmWaGj/vG/MhF4aisoc=
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:kGUqhHd//musdITWjFvNTHn90WG9bMLBEPQZ17Cmlpw=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec h1:1Qb69mGp/UtRPn422BH4/Y4Q3SLUrD9KHuDkm8iodFc=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec/go.mod h1:CD8UlnlLDiqb36L110uqiP2iSflVjx9g/3U9hCI4q2U=
github.com/Peersyst/xrpl-go v0.1.11 h1:P6r/gHxRnbAtAdPmzNHz/7zpsdfvwh0SS+QI2JNT44w=
github.com/Peersyst/xrpl-go v0.1.11/go.mod h1:CBRM3/soqNeeL2Jx6USVUtECqulZVUoq3UxZKMz9hdw=
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 h1:TvGTmUBHDU75OHro9ojPLK+Yv7gDl2hnUvRocRCjsys=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2/go.mod h1:uGfjDyePSpa75cSQLzNdVmWlbQMBuiJkvXw/MNKRY4M=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.1.5-0.20170601210322-f6abca593680/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tyler-smith/go-bip32 v1.0.0 h1:sDR9juArbUgX+bO/iblgZnMPeWY1KZMUC2AFUJdv5KE=
github.com/tyler-smith/go-bip32 v1.0.0/go.mod h1:onot+eHknzV4BVPwrzqY5OoVpyCvnwD7lMawL5aQupE=
github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM=

View File

@@ -0,0 +1,152 @@
package main
import (
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
"github.com/Peersyst/xrpl-go/xrpl/ledger-entry-types"
"github.com/Peersyst/xrpl-go/xrpl/rpc"
"github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
)
func main() {
cfg, err := rpc.NewClientConfig(
"https://s.altnet.rippletest.net:51234/",
rpc.WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
)
if err != nil {
panic(err)
}
client := rpc.NewClient(cfg)
w, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
receiverWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
fmt.Println("Setting up wallets...")
if err := client.FundWallet(&w); err != nil {
panic(err)
}
fmt.Println("Sender wallet funded!")
if err := client.FundWallet(&receiverWallet); err != nil {
panic(err)
}
fmt.Println("Receiver wallet funded!")
fmt.Println()
fmt.Println("Wallets setup complete!")
fmt.Println("Sender wallet:", w.ClassicAddress)
fmt.Println("Receiver wallet:", receiverWallet.ClassicAddress)
fmt.Println()
fmt.Println("Creating check...")
cc := &transaction.CheckCreate{
BaseTx: transaction.BaseTx{
Account: w.GetAddress(),
},
Destination: receiverWallet.GetAddress(),
SendMax: types.XRPCurrencyAmount(1000000),
InvoiceID: "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
}
flatCc := cc.Flatten()
if err := client.Autofill(&flatCc); err != nil {
panic(err)
}
blob, _, err := w.Sign(flatCc)
if err != nil {
panic(err)
}
res, err := client.SubmitTxBlobAndWait(blob, false)
if err != nil {
panic(err)
}
if !res.Validated {
fmt.Println("Check creation failed!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Check created!")
fmt.Printf("Hash: %s\n", res.Hash.String())
fmt.Println()
meta, ok := res.Meta.(map[string]interface{})
if !ok {
fmt.Println("Meta is not of type TxObjMeta")
return
}
var checkID string
affectedNodes := meta["AffectedNodes"].([]interface{})
for _, node := range affectedNodes {
affectedNode, ok := node.(map[string]interface{})
if !ok {
fmt.Println("Node is not of type map[string]interface{}")
return
}
createdNode, ok := affectedNode["CreatedNode"].(map[string]interface{})
if !ok {
continue
}
if createdNode["LedgerEntryType"] == string(ledger.CheckEntry) {
checkID = createdNode["LedgerIndex"].(string)
}
}
if checkID == "" {
fmt.Println("Check not found")
return
}
fmt.Println("Cashing out check...")
checkCash := &transaction.CheckCash{
BaseTx: transaction.BaseTx{
Account: receiverWallet.GetAddress(),
},
CheckID: types.Hash256(checkID),
Amount: types.XRPCurrencyAmount(1000000),
}
flatCheckCash := checkCash.Flatten()
if err := client.Autofill(&flatCheckCash); err != nil {
panic(err)
}
blob, _, err = receiverWallet.Sign(flatCheckCash)
if err != nil {
panic(err)
}
res, err = client.SubmitTxBlobAndWait(blob, false)
if err != nil {
panic(err)
}
fmt.Println("Check cashed out!")
fmt.Printf("Hash: %s\n", res.Hash.String())
fmt.Println()
}

View File

@@ -0,0 +1,163 @@
package main
import (
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
"github.com/Peersyst/xrpl-go/xrpl/ledger-entry-types"
"github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
"github.com/Peersyst/xrpl-go/xrpl/websocket"
)
func main() {
fmt.Println("Connecting to testnet...")
client := websocket.NewClient(
websocket.NewClientConfig().
WithHost("wss://s.altnet.rippletest.net:51233").
WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
)
defer client.Disconnect()
if err := client.Connect(); err != nil {
panic(err)
}
if !client.IsConnected() {
fmt.Println("Failed to connect to testnet")
return
}
fmt.Println("Connected to testnet")
fmt.Println()
w, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
receiverWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
fmt.Println("Setting up wallets...")
if err := client.FundWallet(&w); err != nil {
panic(err)
}
fmt.Println("Sender wallet funded!")
if err := client.FundWallet(&receiverWallet); err != nil {
panic(err)
}
fmt.Println("Receiver wallet funded!")
fmt.Println()
fmt.Println("Wallets setup complete!")
fmt.Println("Sender wallet:", w.ClassicAddress)
fmt.Println("Receiver wallet:", receiverWallet.ClassicAddress)
fmt.Println()
fmt.Println("Creating check...")
cc := &transaction.CheckCreate{
BaseTx: transaction.BaseTx{
Account: w.GetAddress(),
},
Destination: receiverWallet.GetAddress(),
SendMax: types.XRPCurrencyAmount(1000000),
InvoiceID: "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
}
flatCc := cc.Flatten()
if err := client.Autofill(&flatCc); err != nil {
panic(err)
}
blob, _, err := w.Sign(flatCc)
if err != nil {
panic(err)
}
res, err := client.SubmitTxBlobAndWait(blob, false)
if err != nil {
panic(err)
}
if !res.Validated {
fmt.Println("Check creation failed!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Check created!")
fmt.Printf("Hash: %s\n", res.Hash.String())
fmt.Println()
meta, ok := res.Meta.(map[string]interface{})
if !ok {
fmt.Println("Meta is not of type TxObjMeta")
return
}
var checkID string
affectedNodes := meta["AffectedNodes"].([]interface{})
for _, node := range affectedNodes {
affectedNode, ok := node.(map[string]interface{})
if !ok {
fmt.Println("Node is not of type map[string]interface{}")
return
}
createdNode, ok := affectedNode["CreatedNode"].(map[string]interface{})
if !ok {
continue
}
if createdNode["LedgerEntryType"] == string(ledger.CheckEntry) {
checkID = createdNode["LedgerIndex"].(string)
}
}
if checkID == "" {
fmt.Println("Check not found")
return
}
fmt.Println("Cashing out check...")
checkCash := &transaction.CheckCash{
BaseTx: transaction.BaseTx{
Account: receiverWallet.GetAddress(),
},
CheckID: types.Hash256(checkID),
Amount: types.XRPCurrencyAmount(1000000),
}
flatCheckCash := checkCash.Flatten()
if err := client.Autofill(&flatCheckCash); err != nil {
panic(err)
}
blob, _, err = receiverWallet.Sign(flatCheckCash)
if err != nil {
panic(err)
}
res, err = client.SubmitTxBlobAndWait(blob, false)
if err != nil {
panic(err)
}
fmt.Println("Check cashed out!")
fmt.Printf("Hash: %s\n", res.Hash.String())
fmt.Println()
}

View File

@@ -0,0 +1,3 @@
# Clawback
Create, configure, and execute a Clawback transaction to reclaim issued tokens from a trust line on the XRPL.

View File

@@ -0,0 +1,24 @@
module github.com/XRPLF
go 1.23.0
toolchain go1.23.10
require github.com/Peersyst/xrpl-go v0.1.11
require (
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/tyler-smith/go-bip32 v1.0.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/crypto v0.35.0 // indirect
)

View File

@@ -0,0 +1,58 @@
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e h1:ahyvB3q25YnZWly5Gq1ekg6jcmWaGj/vG/MhF4aisoc=
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:kGUqhHd//musdITWjFvNTHn90WG9bMLBEPQZ17Cmlpw=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec h1:1Qb69mGp/UtRPn422BH4/Y4Q3SLUrD9KHuDkm8iodFc=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec/go.mod h1:CD8UlnlLDiqb36L110uqiP2iSflVjx9g/3U9hCI4q2U=
github.com/Peersyst/xrpl-go v0.1.11 h1:P6r/gHxRnbAtAdPmzNHz/7zpsdfvwh0SS+QI2JNT44w=
github.com/Peersyst/xrpl-go v0.1.11/go.mod h1:CBRM3/soqNeeL2Jx6USVUtECqulZVUoq3UxZKMz9hdw=
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 h1:TvGTmUBHDU75OHro9ojPLK+Yv7gDl2hnUvRocRCjsys=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2/go.mod h1:uGfjDyePSpa75cSQLzNdVmWlbQMBuiJkvXw/MNKRY4M=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.1.5-0.20170601210322-f6abca593680/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tyler-smith/go-bip32 v1.0.0 h1:sDR9juArbUgX+bO/iblgZnMPeWY1KZMUC2AFUJdv5KE=
github.com/tyler-smith/go-bip32 v1.0.0/go.mod h1:onot+eHknzV4BVPwrzqY5OoVpyCvnwD7lMawL5aQupE=
github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM=

View File

@@ -0,0 +1,235 @@
package main
import (
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
"github.com/Peersyst/xrpl-go/xrpl/rpc"
transactions "github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
)
const (
currencyCode = "FOO"
)
func main() {
//
// Configure client
//
cfg, err := rpc.NewClientConfig(
"https://s.altnet.rippletest.net:51234/",
rpc.WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
)
if err != nil {
panic(err)
}
client := rpc.NewClient(cfg)
//
// Configure wallets
//
fmt.Println("Setting up wallets...")
coldWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&coldWallet)
if err != nil {
panic(err)
}
fmt.Println("Cold wallet funded!")
hotWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&hotWallet)
if err != nil {
panic(err)
}
fmt.Println("Hot wallet funded!")
fmt.Println()
fmt.Println("Wallets setup complete!")
fmt.Println("Cold wallet:", coldWallet.ClassicAddress)
fmt.Println("Hot wallet:", hotWallet.ClassicAddress)
fmt.Println()
//
// Configure cold address settings
//
fmt.Println("Configuring cold address settings...")
coldWalletAccountSet := &transactions.AccountSet{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
},
TickSize: types.TickSize(5),
TransferRate: types.TransferRate(0),
Domain: types.Domain("6578616D706C652E636F6D"), // example.com
}
coldWalletAccountSet.SetAsfAllowTrustLineClawback()
coldWalletAccountSet.SetDisallowXRP()
coldWalletAccountSet.SetRequireDestTag()
flattenedTx := coldWalletAccountSet.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err := coldWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err := client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Cold wallet unfreezing failed!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Cold address settings configured!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Create trust line from hot to cold address
//
fmt.Println("Creating trust line from hot to cold address...")
hotColdTrustSet := &transactions.TrustSet{
BaseTx: transactions.BaseTx{
Account: types.Address(hotWallet.ClassicAddress),
},
LimitAmount: types.IssuedCurrencyAmount{
Currency: currencyCode,
Issuer: types.Address(coldWallet.ClassicAddress),
Value: "100000000000000",
},
}
flattenedTx = hotColdTrustSet.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = hotWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Trust line from hot to cold address creation failed!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Trust line from hot to cold address created!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Send tokens from cold wallet to hot wallet
//
fmt.Println("Sending tokens from cold wallet to hot wallet...")
coldToHotPayment := &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
},
Amount: types.IssuedCurrencyAmount{
Currency: currencyCode,
Issuer: types.Address(coldWallet.ClassicAddress),
Value: "3800",
},
Destination: types.Address(hotWallet.ClassicAddress),
DestinationTag: types.DestinationTag(1),
}
flattenedTx = coldToHotPayment.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = coldWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Tokens not sent from cold wallet to hot wallet!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Tokens sent from cold wallet to hot wallet!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Claw back tokens from customer one
//
fmt.Println("Clawing back tokens from hot wallet...")
coldWalletClawback := &transactions.Clawback{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
},
Amount: types.IssuedCurrencyAmount{
Currency: currencyCode,
Issuer: types.Address(hotWallet.ClassicAddress),
Value: "50",
},
}
flattenedTx = coldWalletClawback.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = coldWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Tokens not clawed back from customer one!")
fmt.Println("Try again!")
return
}
fmt.Println("Tokens clawed back from customer one!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
}

View File

@@ -0,0 +1,241 @@
package main
import (
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
transactions "github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
"github.com/Peersyst/xrpl-go/xrpl/websocket"
)
const (
currencyCode = "FOO"
)
func main() {
//
// Configure client
//
fmt.Println("Setting up client...")
client := websocket.NewClient(
websocket.NewClientConfig().
WithHost("wss://s.altnet.rippletest.net").
WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
)
fmt.Println("Client configured!")
fmt.Println()
fmt.Println("Connecting to server...")
if err := client.Connect(); err != nil {
panic(err)
}
fmt.Println("Connection: ", client.IsConnected())
//
// Configure wallets
//
fmt.Println("Setting up wallets...")
coldWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&coldWallet)
if err != nil {
panic(err)
}
fmt.Println("Cold wallet funded!")
hotWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&hotWallet)
if err != nil {
panic(err)
}
fmt.Println("Hot wallet funded!")
fmt.Println()
fmt.Println("Wallets setup complete!")
fmt.Println("Cold wallet:", coldWallet.ClassicAddress)
fmt.Println("Hot wallet:", hotWallet.ClassicAddress)
fmt.Println()
//
// Configure cold address settings
//
fmt.Println("Configuring cold address settings...")
coldWalletAccountSet := &transactions.AccountSet{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
},
TickSize: types.TickSize(5),
TransferRate: types.TransferRate(0),
Domain: types.Domain("6578616D706C652E636F6D"), // example.com
}
coldWalletAccountSet.SetAsfAllowTrustLineClawback()
coldWalletAccountSet.SetDisallowXRP()
coldWalletAccountSet.SetRequireDestTag()
flattenedTx := coldWalletAccountSet.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err := coldWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err := client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Cold wallet unfreezing failed!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Cold address settings configured!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Create trust line from hot to cold address
//
fmt.Println("Creating trust line from hot to cold address...")
hotColdTrustSet := &transactions.TrustSet{
BaseTx: transactions.BaseTx{
Account: types.Address(hotWallet.ClassicAddress),
},
LimitAmount: types.IssuedCurrencyAmount{
Currency: currencyCode,
Issuer: types.Address(coldWallet.ClassicAddress),
Value: "100000000000000",
},
}
flattenedTx = hotColdTrustSet.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = hotWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Trust line from hot to cold address creation failed!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Trust line from hot to cold address created!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Send tokens from cold wallet to hot wallet
//
fmt.Println("Sending tokens from cold wallet to hot wallet...")
coldToHotPayment := &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
},
Amount: types.IssuedCurrencyAmount{
Currency: currencyCode,
Issuer: types.Address(coldWallet.ClassicAddress),
Value: "3800",
},
Destination: types.Address(hotWallet.ClassicAddress),
DestinationTag: types.DestinationTag(1),
}
flattenedTx = coldToHotPayment.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = coldWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Tokens not sent from cold wallet to hot wallet!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Tokens sent from cold wallet to hot wallet!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Claw back tokens from customer one
//
fmt.Println("Clawing back tokens from hot wallet...")
coldWalletClawback := &transactions.Clawback{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
},
Amount: types.IssuedCurrencyAmount{
Currency: currencyCode,
Issuer: types.Address(hotWallet.ClassicAddress),
Value: "50",
},
}
flattenedTx = coldWalletClawback.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = coldWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Tokens not clawed back from customer one!")
fmt.Println("Try again!")
return
}
fmt.Println("Tokens clawed back from customer one!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
}

View File

@@ -0,0 +1,3 @@
# Credential
Create, accept, and delete a credential on the XRPL using dedicated transactions between issuer and subject wallets.

View File

@@ -0,0 +1,24 @@
module github.com/XRPLF
go 1.23.0
toolchain go1.23.10
require github.com/Peersyst/xrpl-go v0.1.11
require (
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/tyler-smith/go-bip32 v1.0.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/crypto v0.35.0 // indirect
)

View File

@@ -0,0 +1,58 @@
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e h1:ahyvB3q25YnZWly5Gq1ekg6jcmWaGj/vG/MhF4aisoc=
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:kGUqhHd//musdITWjFvNTHn90WG9bMLBEPQZ17Cmlpw=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec h1:1Qb69mGp/UtRPn422BH4/Y4Q3SLUrD9KHuDkm8iodFc=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec/go.mod h1:CD8UlnlLDiqb36L110uqiP2iSflVjx9g/3U9hCI4q2U=
github.com/Peersyst/xrpl-go v0.1.11 h1:P6r/gHxRnbAtAdPmzNHz/7zpsdfvwh0SS+QI2JNT44w=
github.com/Peersyst/xrpl-go v0.1.11/go.mod h1:CBRM3/soqNeeL2Jx6USVUtECqulZVUoq3UxZKMz9hdw=
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 h1:TvGTmUBHDU75OHro9ojPLK+Yv7gDl2hnUvRocRCjsys=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2/go.mod h1:uGfjDyePSpa75cSQLzNdVmWlbQMBuiJkvXw/MNKRY4M=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.1.5-0.20170601210322-f6abca593680/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tyler-smith/go-bip32 v1.0.0 h1:sDR9juArbUgX+bO/iblgZnMPeWY1KZMUC2AFUJdv5KE=
github.com/tyler-smith/go-bip32 v1.0.0/go.mod h1:onot+eHknzV4BVPwrzqY5OoVpyCvnwD7lMawL5aQupE=
github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM=

View File

@@ -0,0 +1,104 @@
package main
import (
"encoding/hex"
"fmt"
"time"
"github.com/Peersyst/xrpl-go/examples/clients"
"github.com/Peersyst/xrpl-go/pkg/crypto"
rippleTime "github.com/Peersyst/xrpl-go/xrpl/time"
"github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
)
func main() {
// As of February 2025, Credential is only available on Devnet.
client := clients.GetDevnetRpcClient()
// Configure wallets
// Issuer
fmt.Println("Setting up credential issuer wallet...")
issuer, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&issuer)
if err != nil {
panic(err)
}
fmt.Printf("Issuer wallet funded: %s\n", issuer.ClassicAddress)
// -----------------------------------------------------
// Subject (destination)
fmt.Println("Setting up Subject wallet...")
subjectWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&subjectWallet)
if err != nil {
panic(err)
}
fmt.Printf("Subject wallet funded: %s\n", subjectWallet.ClassicAddress)
// -----------------------------------------------------
// Creating the CredentialCreate transaction
fmt.Println("Creating CredentialCreate transaction...")
expiration, err := rippleTime.IsoTimeToRippleTime(time.Now().Add(time.Hour * 24).Format(time.RFC3339))
credentialType := types.CredentialType("6D795F63726564656E7469616C")
if err != nil {
panic(err)
}
txn := &transaction.CredentialCreate{
BaseTx: transaction.BaseTx{
Account: types.Address(issuer.ClassicAddress),
},
CredentialType: credentialType,
Subject: types.Address(subjectWallet.ClassicAddress),
Expiration: uint32(expiration),
URI: hex.EncodeToString([]byte("https://example.com")),
}
clients.SubmitTxBlobAndWait(client, txn, issuer)
// -----------------------------------------------------
// Creating the CredentialAccept transaction
fmt.Println("Creating CredentialAccept transaction...")
acceptTxn := &transaction.CredentialAccept{
BaseTx: transaction.BaseTx{
Account: types.Address(subjectWallet.ClassicAddress),
},
CredentialType: credentialType,
Issuer: types.Address(issuer.ClassicAddress),
}
clients.SubmitTxBlobAndWait(client, acceptTxn, subjectWallet)
// -----------------------------------------------------
// Creating the CredentialDelete transaction
fmt.Println("Creating CredentialDelete transaction...")
deleteTxn := &transaction.CredentialDelete{
BaseTx: transaction.BaseTx{
Account: types.Address(issuer.ClassicAddress),
},
CredentialType: credentialType,
Issuer: types.Address(issuer.ClassicAddress),
Subject: types.Address(subjectWallet.ClassicAddress),
}
clients.SubmitTxBlobAndWait(client, deleteTxn, issuer)
}

View File

@@ -0,0 +1,116 @@
package main
import (
"encoding/hex"
"fmt"
"time"
"github.com/Peersyst/xrpl-go/examples/clients"
"github.com/Peersyst/xrpl-go/pkg/crypto"
rippleTime "github.com/Peersyst/xrpl-go/xrpl/time"
"github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
)
func main() {
fmt.Println("Setting up client...")
client := clients.GetDevnetWebsocketClient()
fmt.Println("Connecting to server...")
if err := client.Connect(); err != nil {
panic(err)
}
fmt.Println("Client configured!")
fmt.Println()
fmt.Printf("Connection: %t", client.IsConnected())
fmt.Println()
// Configure wallets
// Issuer
fmt.Println("Setting up credential issuer wallet...")
issuer, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&issuer)
if err != nil {
panic(err)
}
fmt.Printf("Issuer wallet funded: %s\n", issuer.ClassicAddress)
// -----------------------------------------------------
// Subject (destination)
fmt.Println("Setting up Subject wallet...")
subjectWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&subjectWallet)
if err != nil {
panic(err)
}
fmt.Printf("Subject wallet funded: %s\n", subjectWallet.ClassicAddress)
// -----------------------------------------------------
// Creating the CredentialCreate transaction
fmt.Println("Creating CredentialCreate transaction...")
expiration, err := rippleTime.IsoTimeToRippleTime(time.Now().Add(time.Hour * 24).Format(time.RFC3339))
credentialType := types.CredentialType("6D795F63726564656E7469616C")
if err != nil {
panic(err)
}
txn := &transaction.CredentialCreate{
BaseTx: transaction.BaseTx{
Account: types.Address(issuer.ClassicAddress),
},
CredentialType: credentialType,
Subject: types.Address(subjectWallet.ClassicAddress),
Expiration: uint32(expiration),
URI: hex.EncodeToString([]byte("https://example.com")),
}
clients.SubmitTxBlobAndWait(client, txn, issuer)
// -----------------------------------------------------
// Creating the CredentialAccept transaction
fmt.Println("Creating CredentialAccept transaction...")
acceptTxn := &transaction.CredentialAccept{
BaseTx: transaction.BaseTx{
Account: types.Address(subjectWallet.ClassicAddress),
},
CredentialType: credentialType,
Issuer: types.Address(issuer.ClassicAddress),
}
clients.SubmitTxBlobAndWait(client, acceptTxn, subjectWallet)
// -----------------------------------------------------
// Creating the CredentialDelete transaction
fmt.Println("Creating CredentialDelete transaction...")
deleteTxn := &transaction.CredentialDelete{
BaseTx: transaction.BaseTx{
Account: types.Address(issuer.ClassicAddress),
},
CredentialType: credentialType,
Issuer: types.Address(issuer.ClassicAddress),
Subject: types.Address(subjectWallet.ClassicAddress),
}
clients.SubmitTxBlobAndWait(client, deleteTxn, issuer)
}

View File

@@ -0,0 +1,3 @@
# Delegate
Example delegating payment permission to an account and executing on behalf the delegator.

View File

@@ -0,0 +1,24 @@
module github.com/XRPLF
go 1.23.0
toolchain go1.23.10
require github.com/Peersyst/xrpl-go v0.1.11
require (
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/tyler-smith/go-bip32 v1.0.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/crypto v0.35.0 // indirect
)

View File

@@ -0,0 +1,58 @@
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e h1:ahyvB3q25YnZWly5Gq1ekg6jcmWaGj/vG/MhF4aisoc=
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:kGUqhHd//musdITWjFvNTHn90WG9bMLBEPQZ17Cmlpw=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec h1:1Qb69mGp/UtRPn422BH4/Y4Q3SLUrD9KHuDkm8iodFc=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec/go.mod h1:CD8UlnlLDiqb36L110uqiP2iSflVjx9g/3U9hCI4q2U=
github.com/Peersyst/xrpl-go v0.1.11 h1:P6r/gHxRnbAtAdPmzNHz/7zpsdfvwh0SS+QI2JNT44w=
github.com/Peersyst/xrpl-go v0.1.11/go.mod h1:CBRM3/soqNeeL2Jx6USVUtECqulZVUoq3UxZKMz9hdw=
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 h1:TvGTmUBHDU75OHro9ojPLK+Yv7gDl2hnUvRocRCjsys=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2/go.mod h1:uGfjDyePSpa75cSQLzNdVmWlbQMBuiJkvXw/MNKRY4M=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.1.5-0.20170601210322-f6abca593680/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tyler-smith/go-bip32 v1.0.0 h1:sDR9juArbUgX+bO/iblgZnMPeWY1KZMUC2AFUJdv5KE=
github.com/tyler-smith/go-bip32 v1.0.0/go.mod h1:onot+eHknzV4BVPwrzqY5OoVpyCvnwD7lMawL5aQupE=
github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM=

View File

@@ -0,0 +1,125 @@
package main
import (
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
"github.com/Peersyst/xrpl-go/xrpl/rpc"
"github.com/Peersyst/xrpl-go/xrpl/rpc/types"
transactions "github.com/Peersyst/xrpl-go/xrpl/transaction"
txnTypes "github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
)
func main() {
// Configure the client
cfg, err := rpc.NewClientConfig(
"https://s.devnet.rippletest.net:51234/",
rpc.WithFaucetProvider(faucet.NewDevnetFaucetProvider()),
)
if err != nil {
panic(err)
}
client := rpc.NewClient(cfg)
// Create and fund wallets
delegatorWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
delegateeWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
fmt.Println("Funding wallets...")
if err := client.FundWallet(&delegatorWallet); err != nil {
panic(err)
}
if err := client.FundWallet(&delegateeWallet); err != nil {
panic(err)
}
fmt.Println("Wallets funded")
// Check initial balances
delegatorBalance, err := client.GetXrpBalance(delegatorWallet.ClassicAddress)
if err != nil {
delegatorBalance = "0"
}
delegateeBalance, err := client.GetXrpBalance(delegateeWallet.ClassicAddress)
if err != nil {
delegateeBalance = "0"
}
fmt.Printf("Delegator initial balance: %s XRP\n", delegatorBalance)
fmt.Printf("Delegatee initial balance: %s XRP\n", delegateeBalance)
fmt.Println()
// Create DelegateSet transaction
delegateSetTx := &transactions.DelegateSet{
BaseTx: transactions.BaseTx{
Account: txnTypes.Address(delegatorWallet.ClassicAddress),
},
Authorize: txnTypes.Address(delegateeWallet.ClassicAddress),
Permissions: []txnTypes.Permission{
{
Permission: txnTypes.PermissionValue{
PermissionValue: "Payment",
},
},
},
}
// Submit DelegateSet transaction
response, err := client.SubmitTxAndWait(delegateSetTx.Flatten(), &types.SubmitOptions{
Autofill: true,
Wallet: &delegatorWallet,
})
if err != nil {
panic(err)
}
fmt.Println("DelegateSet transaction submitted")
fmt.Printf("Hash: %s\n", response.Hash)
fmt.Printf("Validated: %t\n", response.Validated)
fmt.Println()
// Create delegated payment transaction
delegatedPaymentTx := &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: txnTypes.Address(delegatorWallet.ClassicAddress),
Delegate: txnTypes.Address(delegateeWallet.ClassicAddress),
},
Destination: txnTypes.Address(delegateeWallet.ClassicAddress),
Amount: txnTypes.XRPCurrencyAmount(1000000), // 1 XRP
}
// Submit delegated payment
response2, err := client.SubmitTxAndWait(delegatedPaymentTx.Flatten(), &types.SubmitOptions{
Autofill: true,
Wallet: &delegateeWallet,
})
if err != nil {
panic(err)
}
fmt.Println("Delegated payment submitted")
fmt.Printf("Hash: %s\n", response2.Hash)
fmt.Printf("Validated: %t\n", response2.Validated)
fmt.Println()
// Check final balances
finalDelegatorBalance, err := client.GetXrpBalance(delegatorWallet.ClassicAddress)
if err != nil {
finalDelegatorBalance = "0"
}
finalDelegateeBalance, err := client.GetXrpBalance(delegateeWallet.ClassicAddress)
if err != nil {
finalDelegateeBalance = "0"
}
fmt.Printf("Delegator final balance: %s XRP\n", finalDelegatorBalance)
fmt.Printf("Delegatee final balance: %s XRP\n", finalDelegateeBalance)
}

View File

@@ -0,0 +1,140 @@
package main
import (
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
transactions "github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
"github.com/Peersyst/xrpl-go/xrpl/websocket"
)
func main() {
// Connect to testnet
client := websocket.NewClient(
websocket.NewClientConfig().
WithHost("wss://s.devnet.rippletest.net:51233").
WithFaucetProvider(faucet.NewDevnetFaucetProvider()),
)
defer client.Disconnect()
if err := client.Connect(); err != nil {
panic(err)
}
// Create and fund wallets
delegatorWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
delegateeWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
fmt.Println("Funding wallets...")
if err := client.FundWallet(&delegatorWallet); err != nil {
panic(err)
}
if err := client.FundWallet(&delegateeWallet); err != nil {
panic(err)
}
fmt.Println("Wallets funded")
// Check initial balances
delegatorBalance, err := client.GetXrpBalance(delegatorWallet.ClassicAddress)
if err != nil {
delegatorBalance = "0"
}
delegateeBalance, err := client.GetXrpBalance(delegateeWallet.ClassicAddress)
if err != nil {
delegateeBalance = "0"
}
fmt.Printf("Delegator initial balance: %s XRP\n", delegatorBalance)
fmt.Printf("Delegatee initial balance: %s XRP\n", delegateeBalance)
fmt.Println()
// Create DelegateSet transaction
delegateSetTx := &transactions.DelegateSet{
BaseTx: transactions.BaseTx{
Account: types.Address(delegatorWallet.ClassicAddress),
},
Authorize: types.Address(delegateeWallet.ClassicAddress),
Permissions: []types.Permission{
{
Permission: types.PermissionValue{
PermissionValue: "Payment",
},
},
},
}
// Submit DelegateSet transaction
flattenedTx := delegateSetTx.Flatten()
if err := client.Autofill(&flattenedTx); err != nil {
panic(err)
}
txBlob, _, err := delegatorWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err := client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
fmt.Println("DelegateSet transaction submitted")
fmt.Printf("Hash: %s\n", response.Hash)
fmt.Printf("Validated: %t\n", response.Validated)
fmt.Println()
// Create delegated payment transaction
delegatedPaymentTx := &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(delegatorWallet.ClassicAddress),
Delegate: types.Address(delegateeWallet.ClassicAddress),
},
Destination: types.Address(delegateeWallet.ClassicAddress),
Amount: types.XRPCurrencyAmount(1000000), // 1 XRP
}
// Submit delegated payment
flatDelegatedPayment := delegatedPaymentTx.Flatten()
if err := client.Autofill(&flatDelegatedPayment); err != nil {
panic(err)
}
txBlob2, _, err := delegateeWallet.Sign(flatDelegatedPayment)
if err != nil {
panic(err)
}
response2, err := client.SubmitTxBlobAndWait(txBlob2, false)
if err != nil {
panic(err)
}
fmt.Println("Delegated payment submitted")
fmt.Printf("Hash: %s\n", response2.Hash)
fmt.Printf("Validated: %t\n", response2.Validated)
fmt.Println()
// Check final balances
finalDelegatorBalance, err := client.GetXrpBalance(delegatorWallet.ClassicAddress)
if err != nil {
finalDelegatorBalance = "0"
}
finalDelegateeBalance, err := client.GetXrpBalance(delegateeWallet.ClassicAddress)
if err != nil {
finalDelegateeBalance = "0"
}
fmt.Printf("Delegator final balance: %s XRP\n", finalDelegatorBalance)
fmt.Printf("Delegatee final balance: %s XRP\n", finalDelegateeBalance)
}

View File

@@ -0,0 +1,3 @@
# DepositPreauth
Example of DepositPreauth transaction demonstrating how deposit permissions can be managed.

View File

@@ -0,0 +1,24 @@
module github.com/XRPLF
go 1.23.0
toolchain go1.23.10
require github.com/Peersyst/xrpl-go v0.1.11
require (
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/tyler-smith/go-bip32 v1.0.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/crypto v0.35.0 // indirect
)

View File

@@ -0,0 +1,58 @@
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e h1:ahyvB3q25YnZWly5Gq1ekg6jcmWaGj/vG/MhF4aisoc=
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:kGUqhHd//musdITWjFvNTHn90WG9bMLBEPQZ17Cmlpw=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec h1:1Qb69mGp/UtRPn422BH4/Y4Q3SLUrD9KHuDkm8iodFc=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec/go.mod h1:CD8UlnlLDiqb36L110uqiP2iSflVjx9g/3U9hCI4q2U=
github.com/Peersyst/xrpl-go v0.1.11 h1:P6r/gHxRnbAtAdPmzNHz/7zpsdfvwh0SS+QI2JNT44w=
github.com/Peersyst/xrpl-go v0.1.11/go.mod h1:CBRM3/soqNeeL2Jx6USVUtECqulZVUoq3UxZKMz9hdw=
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 h1:TvGTmUBHDU75OHro9ojPLK+Yv7gDl2hnUvRocRCjsys=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2/go.mod h1:uGfjDyePSpa75cSQLzNdVmWlbQMBuiJkvXw/MNKRY4M=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.1.5-0.20170601210322-f6abca593680/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tyler-smith/go-bip32 v1.0.0 h1:sDR9juArbUgX+bO/iblgZnMPeWY1KZMUC2AFUJdv5KE=
github.com/tyler-smith/go-bip32 v1.0.0/go.mod h1:onot+eHknzV4BVPwrzqY5OoVpyCvnwD7lMawL5aQupE=
github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM=

View File

@@ -0,0 +1,214 @@
package main
import (
"encoding/hex"
"fmt"
"time"
"github.com/Peersyst/xrpl-go/examples/clients"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/queries/account"
"github.com/Peersyst/xrpl-go/xrpl/queries/common"
rippletime "github.com/Peersyst/xrpl-go/xrpl/time"
"github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
)
func main() {
client := clients.GetDevnetRpcClient()
// Configure wallets
// Issuer
fmt.Println("Setting up credential issuer wallet...")
issuer, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&issuer)
if err != nil {
panic(err)
}
fmt.Printf("Credential issuer wallet funded: %s\n", issuer.ClassicAddress)
// -----------------------------------------------------
// Holder 1
fmt.Println("Setting up holder 1 wallet...")
holderWallet1, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&holderWallet1)
if err != nil {
panic(err)
}
fmt.Printf("Holder 1 wallet funded: %s\n", holderWallet1.ClassicAddress)
// -----------------------------------------------------
// Enabling DepositAuth on the issuer account with an AccountSet transaction
fmt.Println("Enabling DepositAuth on the issuer account...")
accountSetTx := &transaction.AccountSet{
BaseTx: transaction.BaseTx{
Account: issuer.ClassicAddress,
TransactionType: transaction.AccountSetTx,
},
}
accountSetTx.SetAsfDepositAuth()
clients.SubmitTxBlobAndWait(client, accountSetTx, issuer)
// -----------------------------------------------------
// Creating the CredentialCreate transaction
fmt.Println("Creating the CredentialCreate transaction...")
expiration, err := rippletime.IsoTimeToRippleTime(time.Now().Add(time.Hour * 24).Format(time.RFC3339))
if err != nil {
panic(err)
}
credentialType := types.CredentialType("6D795F63726564656E7469616C") // my_credential
credentialCreateTx := &transaction.CredentialCreate{
BaseTx: transaction.BaseTx{
Account: issuer.ClassicAddress,
TransactionType: transaction.CredentialCreateTx,
},
Expiration: uint32(expiration),
CredentialType: credentialType,
Subject: types.Address(holderWallet1.ClassicAddress),
URI: hex.EncodeToString([]byte("https://example.com")),
}
clients.SubmitTxBlobAndWait(client, credentialCreateTx, issuer)
// -----------------------------------------------------
// Creating the CredentialAccept transaction
fmt.Println("Creating the CredentialAccept transaction...")
credentialAcceptTx := &transaction.CredentialAccept{
BaseTx: transaction.BaseTx{
Account: holderWallet1.ClassicAddress,
TransactionType: transaction.CredentialAcceptTx,
},
CredentialType: credentialType,
Issuer: types.Address(issuer.ClassicAddress),
}
clients.SubmitTxBlobAndWait(client, credentialAcceptTx, holderWallet1)
// -----------------------------------------------------
// Creating the DepositPreauth transaction
fmt.Println("Creating the DepositPreauth transaction using AuthorizeCredentials...")
depositPreauthTx := &transaction.DepositPreauth{
BaseTx: transaction.BaseTx{
Account: issuer.ClassicAddress,
TransactionType: transaction.DepositPreauthTx,
},
AuthorizeCredentials: []types.AuthorizeCredentialsWrapper{
{
Credential: types.AuthorizeCredentials{
Issuer: issuer.ClassicAddress,
CredentialType: credentialType,
},
},
},
}
clients.SubmitTxBlobAndWait(client, depositPreauthTx, issuer)
// -----------------------------------------------------
// Get the credential ID
fmt.Println("Getting the credential ID from the holder 1 account...")
objectsRequest := &account.ObjectsRequest{
Account: holderWallet1.ClassicAddress,
Type: account.CredentialObject,
LedgerIndex: common.Validated,
}
objectsResponse, err := client.GetAccountObjects(objectsRequest)
if err != nil {
panic(err)
}
// Check if we have any credential objects
if len(objectsResponse.AccountObjects) == 0 {
fmt.Println("No credential objects found")
return
}
// Extract the credential ID
credentialID, ok := objectsResponse.AccountObjects[0]["index"].(string)
if !ok {
fmt.Println("Could not extract credential ID from response")
return
}
fmt.Printf("Credential ID: %s\n", credentialID)
fmt.Println()
// -----------------------------------------------------
// Sending XRP to the holder 1 account
fmt.Println("Sending XRP to the issuer account, should succeed...")
sendTx := &transaction.Payment{
BaseTx: transaction.BaseTx{
Account: holderWallet1.ClassicAddress,
TransactionType: transaction.PaymentTx,
},
Amount: types.XRPCurrencyAmount(1000000),
Destination: issuer.ClassicAddress,
CredentialIDs: types.CredentialIDs{credentialID},
}
clients.SubmitTxBlobAndWait(client, sendTx, holderWallet1)
// -----------------------------------------------------
// Unauthorizing the holder 1 account
fmt.Println("Unauthorizing the holder 1 account with the DepositPreauth transaction and the UnauthorizeCredentials field...")
unauthorizeTx := &transaction.DepositPreauth{
BaseTx: transaction.BaseTx{
Account: issuer.ClassicAddress,
TransactionType: transaction.DepositPreauthTx,
},
UnauthorizeCredentials: []types.AuthorizeCredentialsWrapper{
{
Credential: types.AuthorizeCredentials{
Issuer: issuer.ClassicAddress,
CredentialType: credentialType,
},
},
},
}
clients.SubmitTxBlobAndWait(client, unauthorizeTx, issuer)
// -----------------------------------------------------
// Sending XRP to the holder 1 account again (which should fail)
fmt.Println("Sending XRP to the issuer account again (which should fail)...")
sendTx2 := &transaction.Payment{
BaseTx: transaction.BaseTx{
Account: holderWallet1.ClassicAddress,
TransactionType: transaction.PaymentTx,
},
Amount: types.XRPCurrencyAmount(1000000),
Destination: issuer.ClassicAddress,
CredentialIDs: types.CredentialIDs{credentialID},
}
clients.SubmitTxBlobAndWait(client, sendTx2, holderWallet1)
}

View File

@@ -0,0 +1,227 @@
package main
import (
"encoding/hex"
"fmt"
"time"
"github.com/Peersyst/xrpl-go/examples/clients"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/queries/account"
"github.com/Peersyst/xrpl-go/xrpl/queries/common"
rippletime "github.com/Peersyst/xrpl-go/xrpl/time"
"github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
)
func main() {
fmt.Println("Setting up client...")
client := clients.GetDevnetWebsocketClient()
fmt.Println("Connecting to server...")
if err := client.Connect(); err != nil {
panic(err)
}
fmt.Println("Client configured!")
fmt.Println()
fmt.Printf("Connection: %t", client.IsConnected())
fmt.Println()
// Configure wallets
// Issuer
fmt.Println("Setting up credential issuer wallet...")
issuer, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&issuer)
if err != nil {
panic(err)
}
fmt.Printf("Credential issuer wallet funded: %s\n", issuer.ClassicAddress)
// -----------------------------------------------------
// Holder 1
fmt.Println("Setting up holder 1 wallet...")
holderWallet1, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&holderWallet1)
if err != nil {
panic(err)
}
fmt.Printf("Holder 1 wallet funded: %s\n", holderWallet1.ClassicAddress)
// -----------------------------------------------------
// Enabling DepositAuth on the issuer account with an AccountSet transaction
fmt.Println("Enabling DepositAuth on the issuer account...")
accountSetTx := &transaction.AccountSet{
BaseTx: transaction.BaseTx{
Account: issuer.ClassicAddress,
TransactionType: transaction.AccountSetTx,
},
}
accountSetTx.SetAsfDepositAuth()
clients.SubmitTxBlobAndWait(client, accountSetTx, issuer)
// -----------------------------------------------------
// Creating the CredentialCreate transaction
fmt.Println("Creating the CredentialCreate transaction...")
expiration, err := rippletime.IsoTimeToRippleTime(time.Now().Add(time.Hour * 24).Format(time.RFC3339))
if err != nil {
panic(err)
}
credentialType := types.CredentialType("6D795F63726564656E7469616C") // my_credential
credentialCreateTx := &transaction.CredentialCreate{
BaseTx: transaction.BaseTx{
Account: issuer.ClassicAddress,
TransactionType: transaction.CredentialCreateTx,
},
Expiration: uint32(expiration),
CredentialType: credentialType,
Subject: types.Address(holderWallet1.ClassicAddress),
URI: hex.EncodeToString([]byte("https://example.com")),
}
clients.SubmitTxBlobAndWait(client, credentialCreateTx, issuer)
// -----------------------------------------------------
// Creating the CredentialAccept transaction
fmt.Println("Creating the CredentialAccept transaction...")
credentialAcceptTx := &transaction.CredentialAccept{
BaseTx: transaction.BaseTx{
Account: holderWallet1.ClassicAddress,
TransactionType: transaction.CredentialAcceptTx,
},
CredentialType: credentialType,
Issuer: types.Address(issuer.ClassicAddress),
}
clients.SubmitTxBlobAndWait(client, credentialAcceptTx, holderWallet1)
// -----------------------------------------------------
// Creating the DepositPreauth transaction
fmt.Println("Creating the DepositPreauth transaction using AuthorizeCredentials...")
depositPreauthTx := &transaction.DepositPreauth{
BaseTx: transaction.BaseTx{
Account: issuer.ClassicAddress,
TransactionType: transaction.DepositPreauthTx,
},
AuthorizeCredentials: []types.AuthorizeCredentialsWrapper{
{
Credential: types.AuthorizeCredentials{
Issuer: issuer.ClassicAddress,
CredentialType: credentialType,
},
},
},
}
clients.SubmitTxBlobAndWait(client, depositPreauthTx, issuer)
// -----------------------------------------------------
// Get the credential ID
fmt.Println("Getting the credential ID from the holder 1 account...")
objectsRequest := &account.ObjectsRequest{
Account: holderWallet1.ClassicAddress,
Type: account.CredentialObject,
LedgerIndex: common.Validated,
}
objectsResponse, err := client.GetAccountObjects(objectsRequest)
if err != nil {
panic(err)
}
// Check if we have any credential objects
if len(objectsResponse.AccountObjects) == 0 {
fmt.Println("No credential objects found")
return
}
// Extract the credential ID
credentialID, ok := objectsResponse.AccountObjects[0]["index"].(string)
if !ok {
fmt.Println("Could not extract credential ID from response")
return
}
fmt.Printf("Credential ID: %s\n", credentialID)
fmt.Println()
// -----------------------------------------------------
// Sending XRP to the holder 1 account
fmt.Println("Sending XRP to the issuer account, should succeed...")
sendTx := &transaction.Payment{
BaseTx: transaction.BaseTx{
Account: holderWallet1.ClassicAddress,
TransactionType: transaction.PaymentTx,
},
Amount: types.XRPCurrencyAmount(1000000),
Destination: issuer.ClassicAddress,
CredentialIDs: types.CredentialIDs{credentialID},
}
clients.SubmitTxBlobAndWait(client, sendTx, holderWallet1)
// -----------------------------------------------------
// Unauthorize the holder 1 account
fmt.Println("Unauthorize the holder 1 account with the DepositPreauth transaction and the UnauthorizeCredentials field...")
unauthorizeTx := &transaction.DepositPreauth{
BaseTx: transaction.BaseTx{
Account: issuer.ClassicAddress,
TransactionType: transaction.DepositPreauthTx,
},
UnauthorizeCredentials: []types.AuthorizeCredentialsWrapper{
{
Credential: types.AuthorizeCredentials{
Issuer: issuer.ClassicAddress,
CredentialType: credentialType,
},
},
},
}
clients.SubmitTxBlobAndWait(client, unauthorizeTx, issuer)
// -----------------------------------------------------
// Sending XRP to the holder 1 account again (which should fail)
fmt.Println("Sending XRP to the issuer account again (which should fail)...")
sendTx2 := &transaction.Payment{
BaseTx: transaction.BaseTx{
Account: holderWallet1.ClassicAddress,
TransactionType: transaction.PaymentTx,
},
Amount: types.XRPCurrencyAmount(1000000),
Destination: issuer.ClassicAddress,
CredentialIDs: types.CredentialIDs{credentialID},
}
clients.SubmitTxBlobAndWait(client, sendTx2, holderWallet1)
}

View File

@@ -1,69 +0,0 @@
'use strict'
const xrpl = require('xrpl');
const cc = require('five-bells-condition');
const crypto = require('crypto');
// Useful Documentation:-
// 1. five-bells-condition: https://www.npmjs.com/package/five-bells-condition
// 2. Crypto module: https://nodejs.org/api/crypto.html
// Your seed value, for testing purposes you can make one with the faucet:
// https://xrpl.org/resources/dev-tools/xrp-faucets
const seed = "sEd7jfWyNG6J71dEojB3W9YdHp2KCjy";
async function main() {
try {
// Connect ----------------------------------------------------------------
const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233');
await client.connect();
// Prepare wallet to sign the transaction ---------------------------------
const wallet = await xrpl.Wallet.fromSeed(seed);
console.log("Wallet Address: ", wallet.address);
console.log("Seed: ", seed);
// Set the escrow finish time ---------------------------------------------
let finishAfter = new Date((new Date().getTime() / 1000) + 120); // 2 minutes from now
finishAfter = new Date(finishAfter * 1000);
console.log("This escrow will finish after: ", finishAfter);
// Construct condition and fulfillment ------------------------------------
const preimageData = crypto.randomBytes(32);
const myFulfillment = new cc.PreimageSha256();
myFulfillment.setPreimage(preimageData);
const conditionHex = myFulfillment.getConditionBinary().toString('hex').toUpperCase();
console.log('Condition:', conditionHex);
console.log('Fulfillment:', myFulfillment.serializeBinary().toString('hex').toUpperCase());
// Prepare EscrowCreate transaction ------------------------------------
const escrowCreateTransaction = {
"TransactionType": "EscrowCreate",
"Account": wallet.address,
"Destination": wallet.address,
"Amount": "6000000", //drops XRP
"DestinationTag": 2023,
"Condition": conditionHex, // Omit this for time-held escrows
"Fee": "12",
"FinishAfter": xrpl.isoTimeToRippleTime(finishAfter.toISOString()),
};
xrpl.validate(escrowCreateTransaction);
// Sign and submit the transaction ----------------------------------------
console.log('Signing and submitting the transaction:',
JSON.stringify(escrowCreateTransaction, null, "\t"), "\n"
);
const response = await client.submitAndWait(escrowCreateTransaction, { wallet });
console.log(`Sequence number: ${response.result.tx_json.Sequence}`);
console.log(`Finished submitting! ${JSON.stringify(response.result, null, "\t")}`);
await client.disconnect();
} catch (error) {
console.log(error);
}
}
main()

View File

@@ -1,9 +1,10 @@
{
"name": "escrow-examples",
"version": "0.0.3",
"version": "2.0.0",
"license": "MIT",
"dependencies": {
"five-bells-condition": "*",
"xrpl": "^4.0.0"
}
"xrpl": "^4.4.0"
},
"type": "module"
}

View File

@@ -0,0 +1,156 @@
import xrpl from 'xrpl'
/* Main function when called as a commandline script ------------------------*/
main()
async function main () {
const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233')
await client.connect()
console.log('Funding new wallet from faucet...')
const { wallet } = await client.fundWallet()
// Define properties of the escrow
const dest_address = 'rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe' // Testnet faucet
const delay = 30 // how long to escrow the funds, in seconds
const amount = '12345' // drops of XRP to send in the escrow
const { escrowSeq, finishAfterRippleTime } = await send_timed_escrow(
client,
wallet,
dest_address,
amount,
delay
)
await wait_for_escrow(client, finishAfterRippleTime)
await finish_escrow(client, wallet, escrowSeq)
client.disconnect()
}
/* send_timed_escrow
* Create a time-based escrow.
* Parameters:
* client (xrpl.Client): network-connected client
* wallet (xrpl.Wallet): sender wallet
* dest_address (string): receiver address in base58
* amount (string): how many drops of XRP to send in escrow
* delay (int): number of seconds until the escrow is mature
* Returns: object with the following keys
* response (xrpl.TxResponse): transaction result from submitAndWait
* escrowSeq (int): sequence number of the created escrow (int)
* finishAfterRippleTime (int): the FinishAfter time of the created escrow,
* in seconds since the Ripple Epoch
*/
async function send_timed_escrow (client, wallet, dest_address, amount, delay) {
// Set the escrow finish time
const finishAfter = new Date()
finishAfter.setSeconds(finishAfter.getSeconds() + delay)
console.log('This escrow will finish after:', finishAfter)
// Convert finishAfter to seconds since the Ripple Epoch:
const finishAfterRippleTime = xrpl.isoTimeToRippleTime(finishAfter.toISOString())
// Construct the EscrowCreate transaction
const escrowCreate = {
TransactionType: 'EscrowCreate',
Account: wallet.address,
Destination: dest_address,
Amount: amount,
FinishAfter: finishAfterRippleTime
}
xrpl.validate(escrowCreate)
// Send the transaction
console.log('Signing and submitting the transaction:',
JSON.stringify(escrowCreate, null, 2))
const response = await client.submitAndWait(escrowCreate, {
wallet,
autofill: true
})
// Display the transaction results & return them
console.log(JSON.stringify(response.result, null, 2))
const escrowSeq = response.result.tx_json.Sequence
console.log(`Escrow sequence is ${escrowSeq}.`)
return {
response,
escrowSeq,
finishAfterRippleTime
}
}
/* wait_for_escrow ------------------------------------------------------------
* Check the ledger close time to see if an escrow can be finished.
* If it's not ready yet, wait a number of seconds equal to the difference
* from the latest ledger close time to the escrow's FinishAfter time.
* Parameters:
* client (xrpl.Client): network-connected client
* finishAfterRippleTime (int): the FinishAfter time of the escrow,
* in seconds since the Ripple Epoch
* Returns: null
*/
async function wait_for_escrow (client, finishAfterRippleTime) {
// Check if escrow can be finished
let escrowReady = false
while (!escrowReady) {
// Check the close time of the latest validated ledger.
// Close times are rounded by about 10 seconds, so the exact time the escrow
// is ready to finish may vary by +/- 10 seconds.
const validatedLedger = await client.request({
command: 'ledger',
ledger_index: 'validated'
})
const ledgerCloseTime = validatedLedger.result.ledger.close_time
console.log('Latest validated ledger closed at',
xrpl.rippleTimeToISOTime(ledgerCloseTime))
if (ledgerCloseTime > finishAfterRippleTime) {
escrowReady = true
console.log('Escrow is ready to be finished.')
} else {
let timeDifference = finishAfterRippleTime - ledgerCloseTime
if (timeDifference === 0) { timeDifference = 1 }
console.log(`Waiting another ${timeDifference} second(s).`)
await sleep(timeDifference)
}
}
}
/* Sleep function that can be used with await */
function sleep (delayInSeconds) {
const delayInMs = delayInSeconds * 1000
return new Promise((resolve) => setTimeout(resolve, delayInMs))
}
/* finish_escrow --------------------------------------------------------------
* Finish an escrow that your account owns.
* Parameters:
* client (xrpl.Client): network-connected client
* wallet (xrpl.Wallet): escrow owner and transaction sender's wallet
* escrowSeq (int): the Sequence number of the escrow to finish
* Returns: null
*/
async function finish_escrow (client, wallet, escrowSeq) {
// Construct the EscrowFinish transaction
const escrowFinish = {
TransactionType: 'EscrowFinish',
Account: wallet.address,
Owner: wallet.address,
OfferSequence: escrowSeq
}
xrpl.validate(escrowFinish)
// Send the transaction
console.log('Signing and submitting the transaction:',
JSON.stringify(escrowFinish, null, 2))
const response2 = await client.submitAndWait(escrowFinish, {
wallet,
autofill: true
})
// Display the transaction results
console.log(JSON.stringify(response2.result, null, 2))
if (response2.result.meta.TransactionResult === 'tesSUCCESS') {
console.log('Escrow finished successfully.')
}
}

View File

@@ -0,0 +1,24 @@
module github.com/XRPLF
go 1.23.0
toolchain go1.23.10
require github.com/Peersyst/xrpl-go v0.1.11
require (
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/tyler-smith/go-bip32 v1.0.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/crypto v0.35.0 // indirect
)

View File

@@ -0,0 +1,58 @@
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e h1:ahyvB3q25YnZWly5Gq1ekg6jcmWaGj/vG/MhF4aisoc=
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:kGUqhHd//musdITWjFvNTHn90WG9bMLBEPQZ17Cmlpw=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec h1:1Qb69mGp/UtRPn422BH4/Y4Q3SLUrD9KHuDkm8iodFc=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec/go.mod h1:CD8UlnlLDiqb36L110uqiP2iSflVjx9g/3U9hCI4q2U=
github.com/Peersyst/xrpl-go v0.1.11 h1:P6r/gHxRnbAtAdPmzNHz/7zpsdfvwh0SS+QI2JNT44w=
github.com/Peersyst/xrpl-go v0.1.11/go.mod h1:CBRM3/soqNeeL2Jx6USVUtECqulZVUoq3UxZKMz9hdw=
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 h1:TvGTmUBHDU75OHro9ojPLK+Yv7gDl2hnUvRocRCjsys=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2/go.mod h1:uGfjDyePSpa75cSQLzNdVmWlbQMBuiJkvXw/MNKRY4M=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.1.5-0.20170601210322-f6abca593680/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tyler-smith/go-bip32 v1.0.0 h1:sDR9juArbUgX+bO/iblgZnMPeWY1KZMUC2AFUJdv5KE=
github.com/tyler-smith/go-bip32 v1.0.0/go.mod h1:onot+eHknzV4BVPwrzqY5OoVpyCvnwD7lMawL5aQupE=
github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM=

View File

@@ -0,0 +1,335 @@
package main
import (
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/currency"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
"github.com/Peersyst/xrpl-go/xrpl/rpc"
transactions "github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
)
const (
currencyCode = "USDA"
)
type SubmittableTransaction interface {
TxType() transactions.TxType
Flatten() transactions.FlatTransaction // Ensures all transactions can be flattened
}
func main() {
client := getRpcClient()
// Configure wallets
// Issuer
fmt.Println("Setting up issuer wallet...")
issuer, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&issuer)
if err != nil {
panic(err)
}
fmt.Printf("Issuer wallet funded: %s\n", issuer.ClassicAddress)
// -----------------------------------------------------
// Holder 1
fmt.Println("Setting up holder 1 wallet...")
holderWallet1, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&holderWallet1)
if err != nil {
panic(err)
}
fmt.Printf("Holder wallet 1 funded: %s\n", holderWallet1.ClassicAddress)
// -----------------------------------------------------
// Holder 2
fmt.Println("Setting up holder 2 wallet...")
holderWallet2, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&holderWallet2)
if err != nil {
panic(err)
}
fmt.Printf("Holder wallet 2 funded: %s\n", holderWallet2.ClassicAddress)
fmt.Println()
fmt.Println("Wallets setup complete!")
fmt.Println()
// -----------------------------------------------------
// Configuring Issuing account
fmt.Println("Configuring issuer address settings...")
accountSet := &transactions.AccountSet{
BaseTx: transactions.BaseTx{
Account: types.Address(issuer.ClassicAddress),
},
Domain: types.Domain("697373756572"), // issuer
}
accountSet.SetAsfDefaultRipple()
submitAndWait(client, accountSet, issuer)
// -----------------------------------------------------
// Trustline from the holder 1 to the issuer
fmt.Println("Setting up trustline from holder 1 to the issuer...")
trustSet := &transactions.TrustSet{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet1.ClassicAddress),
},
LimitAmount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "1000000000",
}}
trustSet.SetSetNoRippleFlag()
submitAndWait(client, trustSet, holderWallet1)
// -----------------------------------------------------
// Trustline from the holder 2 to the issuer
fmt.Println("Setting up trustline from holder 2 to the issuer...")
trustSet = &transactions.TrustSet{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet2.ClassicAddress),
},
LimitAmount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "1000000000",
},
}
trustSet.SetSetNoRippleFlag()
submitAndWait(client, trustSet, holderWallet2)
// -----------------------------------------------------
// Minting to Holder 1
fmt.Println("Minting to Holder 1...")
payment := &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(issuer.ClassicAddress),
},
Destination: types.Address(holderWallet1.ClassicAddress),
Amount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "50000",
},
}
submitAndWait(client, payment, issuer)
// -----------------------------------------------------
// Minting to Holder 2
fmt.Println("Minting to Holder 2...")
payment = &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(issuer.ClassicAddress),
},
Destination: types.Address(holderWallet2.ClassicAddress),
Amount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "40000",
},
}
submitAndWait(client, payment, issuer)
// -----------------------------------------------------
// Sending payment from Holder 1 to Holder 2
fmt.Println("Sending payment from Holder 1 to Holder 2...")
payment = &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet1.ClassicAddress),
},
Destination: types.Address(holderWallet2.ClassicAddress),
Amount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "20",
},
}
submitAndWait(client, payment, holderWallet1)
// -----------------------------------------------------
// Freezing and Deep Freezing holder1
fmt.Println("Freezing and Deep Freezing holder 1 trustline...")
trustSet = &transactions.TrustSet{
BaseTx: transactions.BaseTx{
Account: types.Address(issuer.ClassicAddress),
},
LimitAmount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(holderWallet1.ClassicAddress),
Value: "0",
},
}
trustSet.SetSetFreezeFlag()
trustSet.SetSetDeepFreezeFlag()
submitAndWait(client, trustSet, issuer)
// ------------------- SHOULD FAIL ------------------
// Sending payment from Holder 1 to Holder 2 (which should fail), Holder 1 can't decrease its balance
fmt.Println("Sending payment from Holder 1 to Holder 2 (which should fail). Holder 1 can't decrease its balance...")
payment = &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet1.ClassicAddress),
},
Destination: types.Address(holderWallet2.ClassicAddress),
Amount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "10",
},
}
submitAndWait(client, payment, holderWallet1)
// ------------------- SHOULD FAIL ------------------
// Sending payment from Holder 2 to Holder 1 (which should fail), Holder 1 can't increase its balance
fmt.Println("Sending payment from Holder 2 to Holder 1 (which should fail). Holder 1 can't increase its balance...")
payment = &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet2.ClassicAddress),
},
Destination: types.Address(holderWallet1.ClassicAddress),
Amount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "10",
},
}
submitAndWait(client, payment, holderWallet2)
// ------------------- SHOULD FAIL ------------------
// Creating OfferCreate transaction (which should fail), Holder 1 can't create an offer
fmt.Println("Creating OfferCreate transaction (which should fail). Holder 1 can't create an offer...")
offerCreate := &transactions.OfferCreate{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet1.ClassicAddress),
},
TakerPays: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "10",
},
TakerGets: types.XRPCurrencyAmount(10),
}
submitAndWait(client, offerCreate, holderWallet1)
// -----------------------------------------------------
// Unfreezing and Deep Unfreezing holder 1
fmt.Println("Unfreezing and Deep Unfreezing holder 1 trustline...")
trustSet = &transactions.TrustSet{
BaseTx: transactions.BaseTx{
Account: types.Address(issuer.ClassicAddress),
},
LimitAmount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(holderWallet1.ClassicAddress),
Value: "0",
},
}
trustSet.SetClearFreezeFlag()
trustSet.SetClearDeepFreezeFlag()
submitAndWait(client, trustSet, issuer)
// -----------------------------------------------------
// Sending payment from Holder 1 to Holder 2 (which should succeed), Holder 1 can decrease its balance
fmt.Println("Sending payment from Holder 1 to Holder 2 (which should succeed). Holder 1 can decrease its balance...")
payment = &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet1.ClassicAddress),
},
Destination: types.Address(holderWallet2.ClassicAddress),
Amount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "10",
},
}
submitAndWait(client, payment, holderWallet1)
// -----------------------------------------------------
// Sending payment from Holder 2 to Holder 1 (which should succeed), Holder 1 can increase its balance
fmt.Println("Sending payment from Holder 2 to Holder 1 (which should succeed). Holder 1 can increase its balance...")
payment = &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet2.ClassicAddress),
},
Destination: types.Address(holderWallet1.ClassicAddress),
Amount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "10",
},
}
submitAndWait(client, payment, holderWallet2)
}
// getRpcClient returns a new rpc client
func getRpcClient() *rpc.Client {
cfg, err := rpc.NewClientConfig(
// DeepFreeze only available on Devnet as of February 2025, change to testnet/mainnet once the amendment passes.
"https://s.devnet.rippletest.net:51234",
rpc.WithFaucetProvider(faucet.NewDevnetFaucetProvider()),
)
if err != nil {
panic(err)
}
return rpc.NewClient(cfg)
}
// submitAndWait submits a transaction and waits for it to be included in a validated ledger
func submitAndWait(client *rpc.Client, txn SubmittableTransaction, wallet wallet.Wallet) {
fmt.Printf("Submitting %s transaction...\n", txn.TxType())
flattenedTx := txn.Flatten()
err := client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err := wallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err := client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
fmt.Printf("%s transaction submitted\n", txn.TxType())
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
}

View File

@@ -0,0 +1,344 @@
package main
import (
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/currency"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
transactions "github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
"github.com/Peersyst/xrpl-go/xrpl/websocket"
)
const (
currencyCode = "USDA"
)
type SubmittableTransaction interface {
TxType() transactions.TxType
Flatten() transactions.FlatTransaction // Ensures all transactions can be flattened
}
func main() {
fmt.Println("Setting up client...")
client := getClient()
fmt.Println("Connecting to server...")
if err := client.Connect(); err != nil {
panic(err)
}
fmt.Println("Client configured!")
fmt.Println()
fmt.Printf("Connection: %t", client.IsConnected())
fmt.Println()
// Configure wallets
// Issuer
fmt.Println("Setting up issuer wallet...")
issuer, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&issuer)
if err != nil {
panic(err)
}
fmt.Printf("Issuer wallet funded: %s\n", issuer.ClassicAddress)
// -----------------------------------------------------
// Holder 1
fmt.Println("Setting up holder 1 wallet...")
holderWallet1, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&holderWallet1)
if err != nil {
panic(err)
}
fmt.Printf("Holder wallet 1 funded: %s\n", holderWallet1.ClassicAddress)
// -----------------------------------------------------
// Holder 2
fmt.Println("Setting up holder 2 wallet...")
holderWallet2, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&holderWallet2)
if err != nil {
panic(err)
}
fmt.Printf("Holder wallet 2 funded: %s\n", holderWallet2.ClassicAddress)
fmt.Println()
fmt.Println("Wallets setup complete!")
fmt.Println()
// -----------------------------------------------------
// Configuring Issuing account
fmt.Println("Configuring issuer address settings...")
accountSet := &transactions.AccountSet{
BaseTx: transactions.BaseTx{
Account: types.Address(issuer.ClassicAddress),
},
Domain: types.Domain("697373756572"), // issuer
}
accountSet.SetAsfDefaultRipple()
submitAndWait(client, accountSet, issuer)
// -----------------------------------------------------
// Trustline from the holder 1 to the issuer
fmt.Println("Setting up trustline from holder 1 to the issuer...")
trustSet := &transactions.TrustSet{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet1.ClassicAddress),
},
LimitAmount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "1000000000",
}}
trustSet.SetSetNoRippleFlag()
submitAndWait(client, trustSet, holderWallet1)
// -----------------------------------------------------
// Trustline from the holder 2 to the issuer
fmt.Println("Setting up trustline from holder 2 to the issuer...")
trustSet = &transactions.TrustSet{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet2.ClassicAddress),
},
LimitAmount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "1000000000",
},
}
trustSet.SetSetNoRippleFlag()
submitAndWait(client, trustSet, holderWallet2)
// -----------------------------------------------------
// Minting to Holder 1
fmt.Println("Minting to Holder 1...")
payment := &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(issuer.ClassicAddress),
},
Destination: types.Address(holderWallet1.ClassicAddress),
Amount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "50000",
},
}
submitAndWait(client, payment, issuer)
// -----------------------------------------------------
// Minting to Holder 2
fmt.Println("Minting to Holder 2...")
payment = &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(issuer.ClassicAddress),
},
Destination: types.Address(holderWallet2.ClassicAddress),
Amount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "40000",
},
}
submitAndWait(client, payment, issuer)
// -----------------------------------------------------
// Sending payment from Holder 1 to Holder 2
fmt.Println("Sending payment from Holder 1 to Holder 2...")
payment = &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet1.ClassicAddress),
},
Destination: types.Address(holderWallet2.ClassicAddress),
Amount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "20",
},
}
submitAndWait(client, payment, holderWallet1)
// -----------------------------------------------------
// Freezing and Deep Freezing holder1
fmt.Println("Freezing and Deep Freezing holder 1 trustline...")
trustSet = &transactions.TrustSet{
BaseTx: transactions.BaseTx{
Account: types.Address(issuer.ClassicAddress),
},
LimitAmount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(holderWallet1.ClassicAddress),
Value: "0",
},
}
trustSet.SetSetFreezeFlag()
trustSet.SetSetDeepFreezeFlag()
submitAndWait(client, trustSet, issuer)
// ------------------- SHOULD FAIL ------------------
// Sending payment from Holder 1 to Holder 2 (which should fail), Holder 1 can't decrease its balance
fmt.Println("Sending payment from Holder 1 to Holder 2 (which should fail). Holder 1 can't decrease its balance...")
payment = &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet1.ClassicAddress),
},
Destination: types.Address(holderWallet2.ClassicAddress),
Amount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "10",
},
}
submitAndWait(client, payment, holderWallet1)
// ------------------- SHOULD FAIL ------------------
// Sending payment from Holder 2 to Holder 1 (which should fail), Holder 1 can't increase its balance
fmt.Println("Sending payment from Holder 2 to Holder 1 (which should fail). Holder 1 can't increase its balance...")
payment = &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet2.ClassicAddress),
},
Destination: types.Address(holderWallet1.ClassicAddress),
Amount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "10",
},
}
submitAndWait(client, payment, holderWallet2)
// ------------------- SHOULD FAIL ------------------
// Creating OfferCreate transaction (which should fail), Holder 1 can't create an offer
fmt.Println("Creating OfferCreate transaction (which should fail). Holder 1 can't create an offer...")
offerCreate := &transactions.OfferCreate{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet1.ClassicAddress),
},
TakerPays: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "10",
},
TakerGets: types.XRPCurrencyAmount(10),
}
submitAndWait(client, offerCreate, holderWallet1)
// -----------------------------------------------------
// Unfreezing and Deep Unfreezing holder 1
fmt.Println("Unfreezing and Deep Unfreezing holder 1 trustline...")
trustSet = &transactions.TrustSet{
BaseTx: transactions.BaseTx{
Account: types.Address(issuer.ClassicAddress),
},
LimitAmount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(holderWallet1.ClassicAddress),
Value: "0",
},
}
trustSet.SetClearFreezeFlag()
trustSet.SetClearDeepFreezeFlag()
submitAndWait(client, trustSet, issuer)
// -----------------------------------------------------
// Sending payment from Holder 1 to Holder 2 (which should succeed), Holder 1 can decrease its balance
fmt.Println("Sending payment from Holder 1 to Holder 2 (which should succeed). Holder 1 can decrease its balance...")
payment = &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet1.ClassicAddress),
},
Destination: types.Address(holderWallet2.ClassicAddress),
Amount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "10",
},
}
submitAndWait(client, payment, holderWallet1)
// -----------------------------------------------------
// Sending payment from Holder 2 to Holder 1 (which should succeed), Holder 1 can increase its balance
fmt.Println("Sending payment from Holder 2 to Holder 1 (which should succeed). Holder 1 can increase its balance...")
payment = &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(holderWallet2.ClassicAddress),
},
Destination: types.Address(holderWallet1.ClassicAddress),
Amount: types.IssuedCurrencyAmount{
Currency: currency.ConvertStringToHex(currencyCode),
Issuer: types.Address(issuer.ClassicAddress),
Value: "10",
},
}
submitAndWait(client, payment, holderWallet2)
}
// getRpcClient returns a new rpc client
func getClient() *websocket.Client {
client := websocket.NewClient(
websocket.NewClientConfig().
WithHost("wss://s.devnet.rippletest.net:51233").
WithFaucetProvider(faucet.NewDevnetFaucetProvider()),
)
return client
}
// submitAndWait submits a transaction and waits for it to be included in a validated ledger
func submitAndWait(client *websocket.Client, txn SubmittableTransaction, wallet wallet.Wallet) {
fmt.Printf("Submitting %s transaction...\n", txn.TxType())
flattenedTx := txn.Flatten()
err := client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err := wallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err := client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
fmt.Printf("%s transaction submitted\n", txn.TxType())
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
}

View File

@@ -8,3 +8,4 @@ For more context, see the Get Started tutorial for your preferred language:
- [Java](https://xrpl.org/get-started-using-java.html)
- [JavaScript](https://xrpl.org/get-started-using-javascript.html)
- [PHP](https://xrpl.org/get-started-using-php.html)
- [Go](https://xrpl.org/get-started-using-go.html)

View File

@@ -0,0 +1,30 @@
package main
import (
"github.com/Peersyst/xrpl-go/xrpl/faucet"
"github.com/Peersyst/xrpl-go/xrpl/queries/utility"
"github.com/Peersyst/xrpl-go/xrpl/rpc"
)
func main() {
// Define the network client configuration
cfg, err := rpc.NewClientConfig(
"https://s.altnet.rippletest.net:51234/",
rpc.WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
)
if err != nil {
panic(err)
}
// Initiate the network client
client := rpc.NewClient(cfg)
// Ping the network (used to avoid Go unused variable error, but useful to check connectivity)
_, err = client.Ping(&utility.PingRequest{})
if err != nil {
panic(err)
}
// ... custom code goes here
}

View File

@@ -0,0 +1,25 @@
package main
import (
"github.com/Peersyst/xrpl-go/xrpl/faucet"
"github.com/Peersyst/xrpl-go/xrpl/websocket"
)
func main() {
// Define the network client
client := websocket.NewClient(websocket.NewClientConfig().
WithHost("wss://s.altnet.rippletest.net:51233").
WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
)
// Disconnect the client when done. (Defer executes at the end of the function)
defer client.Disconnect()
// Connect to the network
if err := client.Connect(); err != nil {
panic(err)
}
// ... custom code goes here
}

View File

@@ -0,0 +1,55 @@
package main
import (
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
"github.com/Peersyst/xrpl-go/xrpl/queries/account"
"github.com/Peersyst/xrpl-go/xrpl/queries/common"
"github.com/Peersyst/xrpl-go/xrpl/queries/ledger"
"github.com/Peersyst/xrpl-go/xrpl/rpc"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
)
func main() {
// Define the network client with a faucet provider
cfg, err := rpc.NewClientConfig(
"https://s.altnet.rippletest.net:51234/",
rpc.WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
)
if err != nil {
panic(err)
}
client := rpc.NewClient(cfg)
// Create a new wallet
w, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
fmt.Println("New wallet created:")
fmt.Println("Address:", w.ClassicAddress)
// Fund the wallet with testnet XRP
if err := client.FundWallet(&w); err != nil {
panic(err)
}
// Get info from the ledger about the address we just funded
acc_info, err := client.GetAccountInfo(&account.InfoRequest{
Account: w.GetAddress(),
})
if err != nil {
panic(err)
}
fmt.Println("Account Balance:", acc_info.AccountData.Balance)
fmt.Println("Account Sequence:", acc_info.AccountData.Sequence)
// Get info about the ledger
ledger, err := client.GetLedger(&ledger.Request{LedgerIndex: common.Current})
if err != nil {
panic(err)
}
fmt.Println("Ledger Index:", ledger.Ledger.LedgerIndex)
}

View File

@@ -0,0 +1,69 @@
package main
import (
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
"github.com/Peersyst/xrpl-go/xrpl/queries/account"
"github.com/Peersyst/xrpl-go/xrpl/queries/common"
"github.com/Peersyst/xrpl-go/xrpl/queries/ledger"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
"github.com/Peersyst/xrpl-go/xrpl/websocket"
)
func main() {
// Define the network client with a faucet provider
client := websocket.NewClient(
websocket.NewClientConfig().
WithHost("wss://s.altnet.rippletest.net:51233").
WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
)
// Disconnect the client when done. (Defer executes at the end of the function)
defer client.Disconnect()
// Connect to the network
if err := client.Connect(); err != nil {
panic(err)
}
if !client.IsConnected() {
fmt.Println("Failed to connect to testnet")
return
}
fmt.Println("Connected to testnet")
fmt.Println()
// Create a new wallet
w, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
fmt.Println("New wallet created:")
fmt.Println("Address:", w.ClassicAddress)
// Fund the wallet with testnet XRP
if err := client.FundWallet(&w); err != nil {
panic(err)
}
// Get info from the ledger about the address we just funded
acc_info, err := client.GetAccountInfo(&account.InfoRequest{
Account: w.GetAddress(),
})
if err != nil {
panic(err)
}
fmt.Println("Account Balance:", acc_info.AccountData.Balance)
fmt.Println("Account Sequence:", acc_info.AccountData.Sequence)
// Get info about the ledger
ledger, err := client.GetLedger(&ledger.Request{LedgerIndex: common.Current})
if err != nil {
panic(err)
}
fmt.Println("Ledger Index:", ledger.Ledger.LedgerIndex)
}

View File

@@ -0,0 +1,24 @@
module github.com/XRPLF
go 1.23.0
toolchain go1.23.10
require github.com/Peersyst/xrpl-go v0.1.11
require (
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/tyler-smith/go-bip32 v1.0.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/crypto v0.35.0 // indirect
)

View File

@@ -0,0 +1,58 @@
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e h1:ahyvB3q25YnZWly5Gq1ekg6jcmWaGj/vG/MhF4aisoc=
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:kGUqhHd//musdITWjFvNTHn90WG9bMLBEPQZ17Cmlpw=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec h1:1Qb69mGp/UtRPn422BH4/Y4Q3SLUrD9KHuDkm8iodFc=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec/go.mod h1:CD8UlnlLDiqb36L110uqiP2iSflVjx9g/3U9hCI4q2U=
github.com/Peersyst/xrpl-go v0.1.11 h1:P6r/gHxRnbAtAdPmzNHz/7zpsdfvwh0SS+QI2JNT44w=
github.com/Peersyst/xrpl-go v0.1.11/go.mod h1:CBRM3/soqNeeL2Jx6USVUtECqulZVUoq3UxZKMz9hdw=
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 h1:TvGTmUBHDU75OHro9ojPLK+Yv7gDl2hnUvRocRCjsys=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2/go.mod h1:uGfjDyePSpa75cSQLzNdVmWlbQMBuiJkvXw/MNKRY4M=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.1.5-0.20170601210322-f6abca593680/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tyler-smith/go-bip32 v1.0.0 h1:sDR9juArbUgX+bO/iblgZnMPeWY1KZMUC2AFUJdv5KE=
github.com/tyler-smith/go-bip32 v1.0.0/go.mod h1:onot+eHknzV4BVPwrzqY5OoVpyCvnwD7lMawL5aQupE=
github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM=

View File

@@ -0,0 +1,135 @@
# Get Started Using JavaScript Library
Connects to the XRP Ledger, gets account information, and subscribes to ledger events using JavaScript.
To download the source code, see [Get Started Using JavaScript Library](http://xrpl.org/docs/tutorials/javascript/build-apps/get-started).
## Run the Code
**Node.js**
Quick setup and usage:
```sh
npm install
node ./get-acct-info.js
```
You should see output similar to the following:
```sh
Connected to Testnet
Creating a new wallet and funding it with Testnet XRP...
Wallet: rMnXR9p2sZT9iZ6ew3iEqvBMyPts1ADc4i
Balance: 10
Account Testnet Explorer URL:
https://testnet.xrpl.org/accounts/rMnXR9p2sZT9iZ6ew3iEqvBMyPts1ADc4i
Getting account info...
{
"api_version": 2,
"id": 4,
"result": {
"account_data": {
"Account": "rMnXR9p2sZT9iZ6ew3iEqvBMyPts1ADc4i",
"Balance": "10000000",
"Flags": 0,
"LedgerEntryType": "AccountRoot",
"OwnerCount": 0,
"PreviousTxnID": "0FF9DB2FE141DD0DF82566A171B6AF70BB2C6EB6A53D496E65D42FC062C91A78",
"PreviousTxnLgrSeq": 9949268,
"Sequence": 9949268,
"index": "4A9C9220AE778DC38C004B2B17A08E218416D90E01456AFCF844C18838B36D01"
},
"account_flags": {
"allowTrustLineClawback": false,
"defaultRipple": false,
"depositAuth": false,
"disableMasterKey": false,
"disallowIncomingCheck": false,
"disallowIncomingNFTokenOffer": false,
"disallowIncomingPayChan": false,
"disallowIncomingTrustline": false,
"disallowIncomingXRP": false,
"globalFreeze": false,
"noFreeze": false,
"passwordSpent": false,
"requireAuthorization": false,
"requireDestinationTag": false
},
"ledger_hash": "304C7CC2A33B712BE43EB398B399E290C191A71FCB71784F584544DFB7C441B0",
"ledger_index": 9949268,
"validated": true
},
"type": "response"
}
Listening for ledger close events...
Ledger #9949269 validated with 0 transactions!
Ledger #9949270 validated with 0 transactions!
Ledger #9949271 validated with 0 transactions!
Disconnected
```
**Web**
To run the web example, open `index.html` in a web browser and wait for the results to appear on the page.
You should see output similar to the following:
```text
Connected to Testnet
Creating a new wallet and funding it with Testnet XRP...
Wallet: rf7CWJdNssSzQk2GtypYLVhyvGe8oHS3S
Balance: 10
View account on XRPL Testnet Explorer: rf7CWJdNssSzQk2GtypYLVhyvGe8oHS3S
Getting account info...
{
"api_version": 2,
"id": 5,
"result": {
"account_data": {
"Account": "rf7CWJdNssSzQk2GtypYLVhyvGe8oHS3S",
"Balance": "10000000",
"Flags": 0,
"LedgerEntryType": "AccountRoot",
"OwnerCount": 0,
"PreviousTxnID": "96E4B44F93EC0399B7ADD75489630C6A8DCFC922F20F6810D25490CC0D3AA12E",
"PreviousTxnLgrSeq": 9949610,
"Sequence": 9949610,
"index": "B5D2865DD4BF8EEDFEE2FD95DE37FC28D624548E9BBC42F9FBF61B618E98FAC8"
},
"account_flags": {
"allowTrustLineClawback": false,
"defaultRipple": false,
"depositAuth": false,
"disableMasterKey": false,
"disallowIncomingCheck": false,
"disallowIncomingNFTokenOffer": false,
"disallowIncomingPayChan": false,
"disallowIncomingTrustline": false,
"disallowIncomingXRP": false,
"globalFreeze": false,
"noFreeze": false,
"passwordSpent": false,
"requireAuthorization": false,
"requireDestinationTag": false
},
"ledger_hash": "7692673B8091899C3EEE6807F66B65851D3563F483A49A5F03A83608658473D6",
"ledger_index": 9949610,
"validated": true
},
"type": "response"
}
Listening for ledger close events...
Ledger #9949611 validated with 0 transactions
Ledger #9949612 validated with 1 transactions
Ledger #9949613 validated with 0 transactions
Disconnected
```

View File

@@ -1,17 +1,11 @@
// In browsers, use a <script> tag. In Node.js, uncomment the following line:
// const xrpl = require('xrpl')
// You can also use a <script> tag in browsers or require('xrpl') in Node.js
import xrpl from 'xrpl'
// Wrap code in an async function so we can use await
async function main() {
// Define the network client
const client = new xrpl.Client("wss://s.altnet.rippletest.net:51233")
await client.connect()
// Define the network client
const client = new xrpl.Client("wss://s.altnet.rippletest.net:51233")
await client.connect()
// ... custom code goes here
// ... custom code goes here
// Disconnect when done (If you omit this, Node.js won't end the process)
await client.disconnect()
}
main()
// Disconnect when done (If you omit this, Node.js won't end the process)
client.disconnect()

View File

@@ -1,39 +1,65 @@
// Import the library
const xrpl = require("xrpl")
// @chunk {"steps": ["connect-tag"]}
import xrpl from "xrpl"
// Wrap code in an async function so we can use await
async function main() {
// Define the network client
const SERVER_URL = "wss://s.altnet.rippletest.net:51233/"
const client = new xrpl.Client(SERVER_URL)
await client.connect()
console.log("Connected to Testnet")
// @chunk-end
// Define the network client
const SERVER_URL = "wss://s.altnet.rippletest.net:51233/"
const client = new xrpl.Client(SERVER_URL)
await client.connect()
// @chunk {"steps": ["get-account-create-wallet-tag"]}
// Create a wallet and fund it with the Testnet faucet:
console.log("\nCreating a new wallet and funding it with Testnet XRP...")
const fund_result = await client.fundWallet()
const test_wallet = fund_result.wallet
console.log(`Wallet: ${test_wallet.address}`)
console.log(`Balance: ${fund_result.balance}`)
console.log('Account Testnet Explorer URL:')
console.log(` https://testnet.xrpl.org/accounts/${test_wallet.address}`)
// @chunk-end
// Create a wallet and fund it with the Testnet faucet:
const fund_result = await client.fundWallet()
const test_wallet = fund_result.wallet
console.log(fund_result)
// To generate a wallet without funding it, uncomment the code below
// @chunk {"steps": ["get-account-create-wallet-b-tag"]}
// const test_wallet = xrpl.Wallet.generate()
// @chunk-end
// Get info from the ledger about the address we just funded
const response = await client.request({
"command": "account_info",
"account": test_wallet.address,
"ledger_index": "validated"
})
console.log(response)
// To provide your own seed, replace the test_wallet value with the below
// @chunk {"steps": ["get-account-create-wallet-c-tag"]}
// const test_wallet = xrpl.Wallet.fromSeed("your-seed-key")
// @chunk-end
// Listen to ledger close events
client.request({
"command": "subscribe",
"streams": ["ledger"]
})
client.on("ledgerClosed", async (ledger) => {
console.log(`Ledger #${ledger.ledger_index} validated with ${ledger.txn_count} transactions!`)
})
// @chunk {"steps": ["query-xrpl-tag"]}
// Get info from the ledger about the address we just funded
console.log("\nGetting account info...")
const response = await client.request({
"command": "account_info",
"account": test_wallet.address,
"ledger_index": "validated"
})
console.log(JSON.stringify(response, null, 2))
// @chunk-end
// Disconnect when done so Node.js can end the process
await client.disconnect()
}
// @chunk {"steps": ["listen-for-events-tag"]}
// Listen to ledger close events
console.log("\nListening for ledger close events...")
client.request({
"command": "subscribe",
"streams": ["ledger"]
})
client.on("ledgerClosed", async (ledger) => {
console.log(`Ledger #${ledger.ledger_index} validated ` +
`with ${ledger.txn_count} transactions!`)
})
// @chunk-end
// call the async function
main()
// @chunk {"steps": ["disconnect-node-tag"]}
// Disconnect when done so Node.js can end the process.
// Delay this by 10 seconds to give the ledger event listener time to receive
// and display some ledger events.
setTimeout(async () => {
await client.disconnect();
console.log('\nDisconnected');
}, 10000);
// @chunk-end

View File

@@ -0,0 +1,79 @@
<!DOCTYPE html>
<html>
<head>
<title>XRPL.js Base Example</title>
<!-- @chunk {"steps": ["import-web-tag"]} -->
<script src="https://unpkg.com/xrpl/build/xrpl-latest-min.js"></script>
<!-- @chunk-end -->
</head>
<body>
<h1>XRPL.js Get Started</h1>
<div id="output"></div>
<script>
(async () => {
const output = document.getElementById('output');
// @chunk {"steps": ["connect-tag"]}
// Define the network client
const SERVER_URL = "wss://s.altnet.rippletest.net:51233/"
const client = new xrpl.Client(SERVER_URL)
await client.connect()
output.innerHTML = '<p>Connected to Testnet</p>';
// @chunk-end
// @chunk {"steps": ["get-account-create-wallet-tag"]}
// Create a wallet and fund it with the Testnet faucet:
output.innerHTML += '<p>Creating a new wallet and funding it with Testnet XRP...</p>';
const fund_result = await client.fundWallet()
const test_wallet = fund_result.wallet
output.innerHTML += `<p>Wallet: ${test_wallet.address}</p>`;
output.innerHTML += `<p>Balance: ${fund_result.balance}</p>`;
output.innerHTML += `<p>View account on XRPL Testnet Explorer: <a href="https://testnet.xrpl.org/accounts/${test_wallet.address}" target="_blank">${test_wallet.address}</a></p>`;
// @chunk-end
// To generate a wallet without funding it, uncomment the code below
// @chunk {"steps": ["get-account-create-wallet-b-tag"]}
// const test_wallet = xrpl.Wallet.generate()
// @chunk-end
// To provide your own seed, replace the test_wallet value with the below
// @chunk {"steps": ["get-account-create-wallet-c-tag"]}
// const test_wallet = xrpl.Wallet.fromSeed("your-seed-key")
// @chunk-end
// @chunk {"steps": ["query-xrpl-tag"]}
// Get info from the ledger about the address we just funded
output.innerHTML += `<p>Getting account info...</p>`;
const response = await client.request({
"command": "account_info",
"account": test_wallet.address,
"ledger_index": "validated"
})
output.innerHTML += `<pre>${JSON.stringify(response, null, 2)}</pre>`;
// @chunk-end
// @chunk {"steps": ["listen-for-events-tag"]}
// Listen to ledger close events
output.innerHTML += '<p>Listening for ledger close events...</p>';
client.request({
"command": "subscribe",
"streams": ["ledger"]
})
client.on("ledgerClosed", async (ledger) => {
output.innerHTML += `<p>Ledger #${ledger.ledger_index} validated with ${ledger.txn_count} transactions</p>`;
})
// @chunk-end
// @chunk {"steps": ["disconnect-web-tag"]}
// Disconnect when done. Delay this by 10 seconds to give the ledger event listener time to
// receive and display some ledger events.
setTimeout(async () => {
await client.disconnect();
output.innerHTML += '<p>Disconnected</p>';
}, 10000);
// @chunk-end
})();
</script>
</body>
</html>

View File

@@ -1,5 +1,6 @@
{
"dependencies": {
"xrpl": "^4.0.0"
}
"xrpl": "^4.4.0"
},
"type": "module"
}

View File

@@ -0,0 +1,23 @@
module github.com/XRPLF
go 1.23.0
toolchain go1.23.10
require github.com/Peersyst/xrpl-go v0.1.11
require (
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/tyler-smith/go-bip32 v1.0.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/crypto v0.35.0 // indirect
)

View File

@@ -0,0 +1,56 @@
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e h1:ahyvB3q25YnZWly5Gq1ekg6jcmWaGj/vG/MhF4aisoc=
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:kGUqhHd//musdITWjFvNTHn90WG9bMLBEPQZ17Cmlpw=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec h1:1Qb69mGp/UtRPn422BH4/Y4Q3SLUrD9KHuDkm8iodFc=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec/go.mod h1:CD8UlnlLDiqb36L110uqiP2iSflVjx9g/3U9hCI4q2U=
github.com/Peersyst/xrpl-go v0.1.11 h1:P6r/gHxRnbAtAdPmzNHz/7zpsdfvwh0SS+QI2JNT44w=
github.com/Peersyst/xrpl-go v0.1.11/go.mod h1:CBRM3/soqNeeL2Jx6USVUtECqulZVUoq3UxZKMz9hdw=
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 h1:TvGTmUBHDU75OHro9ojPLK+Yv7gDl2hnUvRocRCjsys=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2/go.mod h1:uGfjDyePSpa75cSQLzNdVmWlbQMBuiJkvXw/MNKRY4M=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.1.5-0.20170601210322-f6abca593680/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tyler-smith/go-bip32 v1.0.0 h1:sDR9juArbUgX+bO/iblgZnMPeWY1KZMUC2AFUJdv5KE=
github.com/tyler-smith/go-bip32 v1.0.0/go.mod h1:onot+eHknzV4BVPwrzqY5OoVpyCvnwD7lMawL5aQupE=
github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM=

View File

@@ -0,0 +1,46 @@
package main
import (
"fmt"
"github.com/Peersyst/xrpl-go/xrpl/queries/common"
"github.com/Peersyst/xrpl-go/xrpl/queries/ledger"
"github.com/Peersyst/xrpl-go/xrpl/queries/transactions"
"github.com/Peersyst/xrpl-go/xrpl/rpc"
)
func main() {
cfg, err := rpc.NewClientConfig(
"https://s.altnet.rippletest.net:51234/",
)
if err != nil {
panic(err)
}
client := rpc.NewClient(cfg)
// Get the latest validated ledger
led, err := client.GetLedger(&ledger.Request{
Transactions: true,
LedgerIndex: common.Validated,
})
if err != nil {
panic(err)
}
fmt.Println("Latest validated ledger:", led)
// Get the first transaction hash from the ledger
if len(led.Ledger.Transactions) > 0 {
txHash := led.Ledger.Transactions[0].(string) // type assertion may be needed
// Query the transaction details
txResp, err := client.Request(&transactions.TxRequest{
Transaction: txHash,
})
if err != nil {
panic(err)
}
fmt.Println("First transaction in the ledger:")
fmt.Println(txResp)
}
}

View File

@@ -0,0 +1,24 @@
module github.com/XRPLF
go 1.23.0
toolchain go1.23.10
require github.com/Peersyst/xrpl-go v0.1.11
require (
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/tyler-smith/go-bip32 v1.0.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/crypto v0.35.0 // indirect
)

View File

@@ -0,0 +1,58 @@
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e h1:ahyvB3q25YnZWly5Gq1ekg6jcmWaGj/vG/MhF4aisoc=
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:kGUqhHd//musdITWjFvNTHn90WG9bMLBEPQZ17Cmlpw=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec h1:1Qb69mGp/UtRPn422BH4/Y4Q3SLUrD9KHuDkm8iodFc=
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec/go.mod h1:CD8UlnlLDiqb36L110uqiP2iSflVjx9g/3U9hCI4q2U=
github.com/Peersyst/xrpl-go v0.1.11 h1:P6r/gHxRnbAtAdPmzNHz/7zpsdfvwh0SS+QI2JNT44w=
github.com/Peersyst/xrpl-go v0.1.11/go.mod h1:CBRM3/soqNeeL2Jx6USVUtECqulZVUoq3UxZKMz9hdw=
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 h1:TvGTmUBHDU75OHro9ojPLK+Yv7gDl2hnUvRocRCjsys=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2/go.mod h1:uGfjDyePSpa75cSQLzNdVmWlbQMBuiJkvXw/MNKRY4M=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.1.5-0.20170601210322-f6abca593680/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tyler-smith/go-bip32 v1.0.0 h1:sDR9juArbUgX+bO/iblgZnMPeWY1KZMUC2AFUJdv5KE=
github.com/tyler-smith/go-bip32 v1.0.0/go.mod h1:onot+eHknzV4BVPwrzqY5OoVpyCvnwD7lMawL5aQupE=
github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8=
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM=

View File

@@ -0,0 +1,488 @@
package main
import (
"fmt"
"github.com/Peersyst/xrpl-go/pkg/crypto"
"github.com/Peersyst/xrpl-go/xrpl/faucet"
"github.com/Peersyst/xrpl-go/xrpl/rpc"
transactions "github.com/Peersyst/xrpl-go/xrpl/transaction"
"github.com/Peersyst/xrpl-go/xrpl/transaction/types"
"github.com/Peersyst/xrpl-go/xrpl/wallet"
)
const (
currencyCode = "FOO"
)
func main() {
//
// Configure client
//
fmt.Println("Setting up client...")
cfg, err := rpc.NewClientConfig(
"https://s.altnet.rippletest.net:51234/",
rpc.WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
)
if err != nil {
panic(err)
}
client := rpc.NewClient(cfg)
fmt.Println("Client configured!")
fmt.Println()
//
// Configure wallets
//
fmt.Println("Setting up wallets...")
coldWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&coldWallet)
if err != nil {
panic(err)
}
fmt.Println("Cold wallet funded!")
hotWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&hotWallet)
if err != nil {
panic(err)
}
fmt.Println("Hot wallet funded!")
customerOneWallet, err := wallet.New(crypto.ED25519())
if err != nil {
panic(err)
}
err = client.FundWallet(&customerOneWallet)
if err != nil {
panic(err)
}
fmt.Println("Customer one wallet funded!")
fmt.Println()
fmt.Println("Wallets setup complete!")
fmt.Println("Cold wallet:", coldWallet.ClassicAddress)
fmt.Println("Hot wallet:", hotWallet.ClassicAddress)
fmt.Println("Customer one wallet:", customerOneWallet.ClassicAddress)
fmt.Println()
//
// Configure cold address settings
//
fmt.Println("Configuring cold address settings...")
coldWalletAccountSet := &transactions.AccountSet{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
},
TickSize: types.TickSize(5),
TransferRate: types.TransferRate(0),
Domain: types.Domain("6578616D706C652E636F6D"), // example.com
}
coldWalletAccountSet.SetAsfDefaultRipple()
coldWalletAccountSet.SetDisallowXRP()
coldWalletAccountSet.SetRequireDestTag()
flattenedTx := coldWalletAccountSet.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err := coldWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err := client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Cold address settings configuration failed!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Cold address settings configured!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Configure hot address settings
//
fmt.Println("Configuring hot address settings...")
hotWalletAccountSet := &transactions.AccountSet{
BaseTx: transactions.BaseTx{
Account: types.Address(hotWallet.ClassicAddress),
},
Domain: types.Domain("6578616D706C652E636F6D"), // example.com
}
hotWalletAccountSet.SetAsfRequireAuth()
hotWalletAccountSet.SetDisallowXRP()
hotWalletAccountSet.SetRequireDestTag()
flattenedTx = hotWalletAccountSet.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = hotWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Hot address settings configuration failed!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Hot address settings configured!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Create trust line from hot to cold address
//
fmt.Println("Creating trust line from hot to cold address...")
hotColdTrustSet := &transactions.TrustSet{
BaseTx: transactions.BaseTx{
Account: types.Address(hotWallet.ClassicAddress),
},
LimitAmount: types.IssuedCurrencyAmount{
Currency: currencyCode,
Issuer: types.Address(coldWallet.ClassicAddress),
Value: "100000000000000",
},
}
flattenedTx = hotColdTrustSet.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = hotWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Trust line from hot to cold address creation failed!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Trust line from hot to cold address created!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Create trust line from costumer one to cold address
//
fmt.Println("Creating trust line from customer one to cold address...")
customerOneColdTrustSet := &transactions.TrustSet{
BaseTx: transactions.BaseTx{
Account: types.Address(customerOneWallet.ClassicAddress),
},
LimitAmount: types.IssuedCurrencyAmount{
Currency: currencyCode,
Issuer: types.Address(coldWallet.ClassicAddress),
Value: "100000000000000",
},
}
flattenedTx = customerOneColdTrustSet.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = customerOneWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Trust line from customer one to cold address creation failed!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Trust line from customer one to cold address created!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Send tokens from cold wallet to hot wallet
//
fmt.Println("Sending tokens from cold wallet to hot wallet...")
coldToHotPayment := &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
},
Amount: types.IssuedCurrencyAmount{
Currency: currencyCode,
Issuer: types.Address(coldWallet.ClassicAddress),
Value: "3800",
},
Destination: types.Address(hotWallet.ClassicAddress),
DestinationTag: types.DestinationTag(1),
}
flattenedTx = coldToHotPayment.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = coldWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Tokens not sent from cold wallet to hot wallet!")
fmt.Println("Try again!")
fmt.Println()
return
}
fmt.Println("Tokens sent from cold wallet to hot wallet!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Send tokens from hot wallet to customer one
//
fmt.Println("Sending tokens from cold wallet to customer one...")
coldToCustomerOnePayment := &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
},
Amount: types.IssuedCurrencyAmount{
Currency: currencyCode,
Issuer: types.Address(coldWallet.ClassicAddress),
Value: "100",
},
Destination: types.Address(customerOneWallet.ClassicAddress),
}
flattenedTx = coldToCustomerOnePayment.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = coldWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Tokens not sent from cold wallet to customer one!")
fmt.Println()
return
}
fmt.Println("Tokens sent from cold wallet to customer one!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Freeze cold wallet
//
fmt.Println("Freezing cold wallet...")
freezeColdWallet := &transactions.AccountSet{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
},
}
freezeColdWallet.SetAsfGlobalFreeze()
flattenedTx = freezeColdWallet.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = coldWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Cold wallet freezing failed!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
return
}
fmt.Println("Cold wallet frozen!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Try to send tokens from hot wallet to customer one
//
fmt.Println("Trying to send tokens from hot wallet to customer one...")
hotToCustomerOnePayment := &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(hotWallet.ClassicAddress),
},
Amount: types.IssuedCurrencyAmount{
Currency: currencyCode,
Issuer: types.Address(coldWallet.ClassicAddress),
Value: "100",
},
Destination: types.Address(customerOneWallet.ClassicAddress),
}
flattenedTx = hotToCustomerOnePayment.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = hotWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
_, err = client.SubmitTxBlobAndWait(txBlob, false)
if err == nil {
return
}
fmt.Println("Tokens not sent from hot wallet to customer one!")
fmt.Println()
// //
// // Unfreeze cold wallet
// //
fmt.Println("Unfreezing cold wallet...")
unfreezeColdWallet := &transactions.AccountSet{
BaseTx: transactions.BaseTx{
Account: types.Address(coldWallet.ClassicAddress),
},
}
unfreezeColdWallet.ClearAsfGlobalFreeze()
flattenedTx = unfreezeColdWallet.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = coldWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Cold wallet unfreezing failed!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
return
}
fmt.Println("Cold wallet unfrozen!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
//
// Try to send tokens from hot wallet to customer one
//
fmt.Println("Trying to send tokens from hot wallet to customer one...")
hotToCustomerOnePayment = &transactions.Payment{
BaseTx: transactions.BaseTx{
Account: types.Address(hotWallet.ClassicAddress),
},
Amount: types.IssuedCurrencyAmount{
Currency: currencyCode,
Issuer: types.Address(coldWallet.ClassicAddress),
Value: "100",
},
Destination: types.Address(customerOneWallet.ClassicAddress),
}
flattenedTx = hotToCustomerOnePayment.Flatten()
err = client.Autofill(&flattenedTx)
if err != nil {
panic(err)
}
txBlob, _, err = hotWallet.Sign(flattenedTx)
if err != nil {
panic(err)
}
response, err = client.SubmitTxBlobAndWait(txBlob, false)
if err != nil {
panic(err)
}
if !response.Validated {
fmt.Println("Tokens not sent from hot wallet to customer one!")
fmt.Println("Try again!")
return
}
fmt.Println("Tokens sent from hot wallet to customer one!")
fmt.Printf("Hash: %s\n", response.Hash.String())
fmt.Println()
}

Some files were not shown because too many files have changed in this diff Show More