Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
v0.7.0-rc.0: accommodate latest changes from SEP-24 spec (#305)
Browse files Browse the repository at this point in the history
- Add support for optional lang parameter when fetching transactions
- Add pending_user_transfer_complete and refunded transaction statuses
- Add refunds object to transaction interface
- Add some other missing transaction params:
    - amount_in_asset
    - amount_out_asset
    - amount_fee_asset
    - kyc_verified
    - claimable_balance_id
- Updated tests
  • Loading branch information
CassioMG authored May 20, 2022
1 parent ea375ff commit f3b5a3e
Show file tree
Hide file tree
Showing 9 changed files with 820 additions and 90 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
## In master

## [v0.7.0-rc.0](https://github.com/stellar/js-stellar-wallets/compare/v0.6.0-rc.1...v0.7.0-rc.0)

This release updates the SDK to accommodate latest changes from [SEP-24 spec](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md#changelog):
- [v2.4.0](https://github.com/stellar/stellar-protocol/pull/1195)
- [v2.3.0](https://github.com/stellar/stellar-protocol/pull/1191)
- [v2.2.1](https://github.com/stellar/stellar-protocol/pull/1185)
- [v2.2.0](https://github.com/stellar/stellar-protocol/pull/1128)

All changes:
- Add support for optional `lang` parameter when fetching transactions
- Add `pending_user_transfer_complete` and `refunded` transaction statuses
- Add `refunds` object to transaction interface
- Add some other missing transaction params:
- amount_in_asset
- amount_out_asset
- amount_fee_asset
- kyc_verified
- claimable_balance_id

## [v0.6.0-rc.1](https://github.com/stellar/js-stellar-wallets/compare/v0.6.0-rc.0...v0.6.0-rc.1)

- Fix ":lp" string

## [v0.6.0-rc.0](https://github.com/stellar/js-stellar-wallets/compare/v0.5.0-rc.0...v0.6.0-rc.0)

- Upgrade stellar-sdk and add LP handling

## [v0.5.0-rc.0](https://github.com/stellar/js-stellar-wallets/compare/v0.4.0-rc.0...v0.5.0-rc.0)

- Use @stellar/freighter-api@1.1.2 for testnet transactions

## [v0.4.0-rc.0](https://github.com/stellar/js-stellar-wallets/compare/v0.3.0-rc.9...v0.4.0-rc.0)

Validate fetchAuthTokens with stellar-sdk's utils
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stellar/wallet-sdk",
"version": "0.6.0-rc.1",
"version": "0.7.0-rc.0",
"description": "Libraries to help you write Stellar-enabled wallets in Javascript",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
10 changes: 6 additions & 4 deletions src/constants/transfers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ export enum TransferResponseType {
}

export enum TransactionStatus {
completed = "completed",
incomplete = "incomplete",
pending_user_transfer_start = "pending_user_transfer_start",
pending_user_transfer_complete = "pending_user_transfer_complete",
pending_external = "pending_external",
pending_anchor = "pending_anchor",
pending_stellar = "pending_stellar",
pending_trust = "pending_trust",
pending_user = "pending_user",
pending_user_transfer_start = "pending_user_transfer_start",
incomplete = "incomplete",
completed = "completed",
refunded = "refunded",
no_market = "no_market",
too_small = "too_small",
too_large = "too_large",
error = "error",
}
}
78 changes: 78 additions & 0 deletions src/fixtures/TransactionsResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,66 @@ export const TransactionsResponse = {
external_transaction_id: "DIF42035EBF5F623CE",
kind: "deposit",
},
{
id: 76,
order_id: "ord_2mPnPq1fnw7QWAr4T",
status: "pending_user_transfer_complete",
receiving_account_number: "646180111812345678",
receiving_account_bank: "STP",
memo: null,
memo_type: null,
email_address: null,
type: "SPEI",
asset_code: "SMX",
expires_at: "1970-01-19T07:09:25.989Z",
created_at: "2019-09-26T22:35:09.505Z",
phone: "+14155099007",
amount: "25.00",
account: "GARBRF35ZWKO4MIEY7RPHHPQ74P45TWNMIQ5VKOTXF7KYVFJBGWW2IMQ",
transaction_id: "DIF42035EBF5F61405",
external_transaction_id: "DIF42035EBF5F61405",
kind: "deposit",
},
{
id: 77,
order_id: "ord_2mRPdvpUjPN2rfuS7",
status: "refunded",
receiving_account_number: "646180111812345678",
receiving_account_bank: "STP",
memo: null,
memo_type: null,
email_address: null,
type: "SPEI",
asset_code: "SMX",
expires_at: "1970-01-19T09:23:30.864Z",
created_at: "2019-10-01T20:34:24.753Z",
phone: "+14155099007",
amount: "25.00",
account: "GARBRF35ZWKO4MIEY7RPHHPQ74P45TWNMIQ5VKOTXF7KYVFJBGWW2IMQ",
transaction_id: "DI938432727A0B2456",
external_transaction_id: "DI938432727A0B2456",
refunds: {
amount_refunded: "25.00",
amount_fee: "5",
payments: [
{
id: "1937103",
id_type: "external",
amount: "10",
fee: "5",
},
{
id:
// tslint:disable-next-line:max-line-length
"b9d0b2292c4e09e8eb22d036171491e87b8d2086bf8b265874c8d182cb9c9020",
id_type: "stellar",
amount: "15",
fee: "0",
},
],
},
kind: "deposit",
},
{
id: 79,
order_id: "ord_2mRPdvpUjPN2rAr4T",
Expand All @@ -59,6 +119,24 @@ export const TransactionsResponse = {
account: "GARBRF35ZWKO4MIEY7RPHHPQ74P45TWNMIQ5VKOTXF7KYVFJBGWW2IMQ",
transaction_id: "DI938432727A0B1405",
external_transaction_id: "DI938432727A0B1405",
refunds: {
amount_refunded: "15.00",
amount_fee: "4",
payments: [
{
id: "2457950",
id_type: "external",
amount: "10",
fee: "2",
},
{
id: "1237435",
id_type: "external",
amount: "5",
fee: "2",
},
],
},
kind: "deposit",
},
{
Expand Down
Loading

0 comments on commit f3b5a3e

Please sign in to comment.