-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
209 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { AxiosInstance } from "axios"; | ||
import { Anchor } from "../Anchor"; | ||
|
||
export interface Sep38Info { | ||
assets: Array<Sep38AssetInfo>; | ||
} | ||
|
||
export interface Sep38AssetInfo { | ||
asset: string; | ||
sell_delivery_methods?: Array<Sep38DeliveryMethod>; | ||
buy_delivery_methods?: Array<Sep38DeliveryMethod>; | ||
country_codes?: Array<string>; | ||
} | ||
|
||
export interface Sep38DeliveryMethod { | ||
name: string; | ||
description: string; | ||
} | ||
|
||
export type Sep38Params = { | ||
anchor: Anchor; | ||
httpClient: AxiosInstance; | ||
}; | ||
|
||
export interface Sep38PricesParams { | ||
sellAsset: string; | ||
sellAmount: string; | ||
sellDeliveryMethod?: string; | ||
buyDeliveryMethod?: string; | ||
countryCode?: string; | ||
} | ||
|
||
export interface Sep38PricesResponse { | ||
buy_assets: Array<Sep38BuyAsset>; | ||
} | ||
|
||
export interface Sep38BuyAsset { | ||
asset: string; | ||
price: string; | ||
decimals: number; | ||
} | ||
|
||
export interface Sep38PriceParams { | ||
sellAsset: string; | ||
buyAsset: string; | ||
sellAmount?: string; | ||
buyAmount?: string; | ||
context: Sep38PriceContext; | ||
sellDeliveryMethod?: string; | ||
buyDeliveryMethod?: string; | ||
countryCode?: string; | ||
} | ||
|
||
export enum Sep38PriceContext { | ||
SEP6 = "sep6", | ||
SEP31 = "sep31", | ||
} | ||
|
||
export interface Sep38PriceResponse { | ||
total_price: string; | ||
price: string; | ||
sell_amount: string; | ||
buy_amount: string; | ||
fee: { | ||
total: string; | ||
asset: string; | ||
details?: Array<Sep38FeeDetails>; | ||
}; | ||
} | ||
|
||
export interface Sep38FeeDetails { | ||
name: string; | ||
description?: string; | ||
amount: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters