Skip to content

Commit

Permalink
add sep-30 support
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-rogobete committed Oct 26, 2023
1 parent d7c0b24 commit 4075cd3
Show file tree
Hide file tree
Showing 9 changed files with 776 additions and 30 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [1.6.8] - 26.Oct.2023.
- add sep-30 support
- rename expirationLedgerSeq from rpc response

## [1.6.7] - 26.Oct.2023.
- add sep-30 support
- rename expirationLedgerSeq from rpc response

## [1.6.6] - 24.Oct.2023.
- update stable version of p20

Expand Down
58 changes: 30 additions & 28 deletions README.md

Large diffs are not rendered by default.

Binary file modified documentation/sdk_api_doc.zip
Binary file not shown.
61 changes: 61 additions & 0 deletions documentation/sdk_examples/sep-0030.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

# SEP-0030 - Account Recovery: multi-party recovery of Stellar accounts

Enables an individual (e.g., a user or wallet) to regain access to a Stellar account as defined by
[SEP-0030: Account Recovery](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0030.md).


## Create a SEP30RecoveryService instance

**By providing the recovery server url directly via the constructor:**

```dart
final service = SEP30RecoveryService("http://api.stellar-test.org/recovery");
```

## Register an account

```dart
var request = SEP30Request([senderIdentity, receiverIdentity]);
SEP30AccountResponse response = await service.registerAccount(addressA, request, jwtToken);
```

## Update identities for an account

```dart
var request = SEP30Request([sender2Identity, receiver2Identity]);
SEP30AccountResponse response = await service.updateIdentitiesForAccount(addressA, request, jwtToken);
```

## Sign a transaction

```dart
var transaction = "AAAAAHAHhQtYBh5F2zA6...";
SEP30SignatureResponse response = await service.signTransaction(
addressA, signingAddress, transaction, jwtToken);
```

## Get account details

```dart
SEP30AccountResponse response = await service.accountDetails(addressA, jwtToken);
```

## Delete account

```dart
SEP30AccountResponse response = await service.deleteAccount(addressA, jwtToken);
```


## List accounts

```dart
SEP30AccountsResponse response = await service.accounts(jwtToken,
after: "GA5TKKASNJZGZAP6FH65HO77CST7CJNYRTW4YPBNPXYMZAHHMTHDZKDQ");
```

### Further readings

SDK's [SEP-30 test cases](https://github.com/Soneso/stellar_flutter_sdk/blob/master/test/sep0030_test.dart).

Loading

0 comments on commit 4075cd3

Please sign in to comment.