@xoxno/sdk-js 1.0.213 → 1.0.215
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -42
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/sdk/index.d.ts +4 -4
- package/dist/cjs/sdk/stellar/__tests__/integration.test.d.ts +1 -0
- package/dist/cjs/sdk/stellar/admin.d.ts +28 -28
- package/dist/cjs/sdk/stellar/cctp.d.ts +2 -2
- package/dist/cjs/sdk/stellar/contracts.d.ts +98 -61
- package/dist/cjs/sdk/stellar/events/index.d.ts +2 -2
- package/dist/cjs/sdk/stellar/governance.d.ts +50 -49
- package/dist/cjs/sdk/stellar/index.d.ts +22 -14
- package/dist/cjs/sdk/stellar/lending-api-types.d.ts +943 -0
- package/dist/cjs/sdk/stellar/lending-read-types.d.ts +54 -269
- package/dist/cjs/sdk/stellar/lending-read.d.ts +279 -131
- package/dist/cjs/sdk/stellar/lending.d.ts +134 -63
- package/dist/cjs/sdk/stellar/prepare.d.ts +27 -7
- package/dist/cjs/sdk/stellar/quote.d.ts +16 -9
- package/dist/cjs/sdk/stellar/swap.d.ts +4 -5
- package/dist/cjs/sdk/stellar-schema.d.ts +5 -0
- package/dist/cjs/sdk/swagger.d.ts +63 -51
- package/dist/cjs/sdk/types.d.ts +2 -2
- package/dist/cjs/utils/__tests__/request-timeout.test.d.ts +1 -0
- package/dist/cjs/utils/api.d.ts +35 -4
- package/dist/cjs/utils/const.d.ts +0 -2
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.LICENSE.txt +8 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.LICENSE.txt +8 -0
- package/dist/sdk/index.d.ts +4 -4
- package/dist/sdk/stellar/__tests__/integration.test.d.ts +1 -0
- package/dist/sdk/stellar/admin.d.ts +28 -28
- package/dist/sdk/stellar/cctp.d.ts +2 -2
- package/dist/sdk/stellar/contracts.d.ts +98 -61
- package/dist/sdk/stellar/events/index.d.ts +2 -2
- package/dist/sdk/stellar/governance.d.ts +50 -49
- package/dist/sdk/stellar/index.cjs +2 -1
- package/dist/sdk/stellar/index.cjs.LICENSE.txt +8 -0
- package/dist/sdk/stellar/index.d.ts +22 -14
- package/dist/sdk/stellar/index.esm.js +2 -1
- package/dist/sdk/stellar/index.esm.js.LICENSE.txt +8 -0
- package/dist/sdk/stellar/lending-api-types.d.ts +943 -0
- package/dist/sdk/stellar/lending-read-types.d.ts +54 -269
- package/dist/sdk/stellar/lending-read.d.ts +279 -131
- package/dist/sdk/stellar/lending.d.ts +134 -63
- package/dist/sdk/stellar/prepare.d.ts +27 -7
- package/dist/sdk/stellar/quote.d.ts +16 -9
- package/dist/sdk/stellar/swap.d.ts +4 -5
- package/dist/sdk/stellar-schema.d.ts +5 -0
- package/dist/sdk/swagger.d.ts +63 -51
- package/dist/sdk/types.d.ts +2 -2
- package/dist/utils/__tests__/request-timeout.test.d.ts +1 -0
- package/dist/utils/api.d.ts +35 -4
- package/dist/utils/const.d.ts +0 -2
- package/package.json +9 -4
package/README.md
CHANGED
|
@@ -8,14 +8,24 @@ npm install @xoxno/sdk-js
|
|
|
8
8
|
|
|
9
9
|
## Basic usage
|
|
10
10
|
|
|
11
|
+
For Stellar lending, start with the [integration guide](md/stellar-lending.md)
|
|
12
|
+
and [checked example](examples/stellar-lending.ts). They cover typed market
|
|
13
|
+
discovery and unsigned XDR preparation, wallet signing, submission and confirmation.
|
|
14
|
+
Generate focused API documentation with `npm run docs:stellar`.
|
|
15
|
+
`XOXNOClient` requires an application-supplied `apiUrl`; the SDK does not read
|
|
16
|
+
environment variables or select an API deployment for you.
|
|
17
|
+
For Stellar infrastructure, use the exported `STELLAR_NETWORKS` manifest and
|
|
18
|
+
pass its selected RPC, quote-server and contract values to your host clients.
|
|
19
|
+
|
|
11
20
|
```typescript
|
|
12
21
|
import { cache } from 'react'
|
|
13
22
|
|
|
14
23
|
import { buildSdk, XOXNOClient } from '@xoxno/sdk-js'
|
|
24
|
+
const apiUrl = 'https://api.example.com'
|
|
15
25
|
|
|
16
26
|
// You can safely call `getSdk()` wherever you need it
|
|
17
27
|
export const getSdk = cache(() => {
|
|
18
|
-
return buildSdk(new XOXNOClient())
|
|
28
|
+
return buildSdk(new XOXNOClient({ apiUrl }))
|
|
19
29
|
})
|
|
20
30
|
```
|
|
21
31
|
|
|
@@ -783,127 +793,133 @@ sdk.stellar.tokens(...); // TokenDataDocHydrated[]
|
|
|
783
793
|
sdk.stellar.aggregator.quote(...); // SoroswapQuoteResponseDto
|
|
784
794
|
|
|
785
795
|
// GET /stellar-lending/assets
|
|
786
|
-
sdk.stellarLending.assets(...); // StellarAssetListItemDto
|
|
796
|
+
sdk.stellarLending.assets(...); // Array<StellarApi.StellarAssetListItemDto>
|
|
787
797
|
|
|
788
798
|
// GET /stellar-lending/context
|
|
789
|
-
sdk.stellarLending.context(...); // StellarLendingContextDto
|
|
799
|
+
sdk.stellarLending.context(...); // StellarApi.StellarLendingContextDto
|
|
790
800
|
|
|
791
801
|
// GET /stellar-lending/live-state
|
|
792
|
-
sdk.stellarLending.liveState(...); // StellarLendingLiveStateDto
|
|
802
|
+
sdk.stellarLending.liveState(...); // StellarApi.StellarLendingLiveStateDto
|
|
793
803
|
|
|
794
804
|
// GET /stellar-lending/markets/detailed
|
|
795
|
-
sdk.stellarLending.markets.detailed(...); // StellarDetailedMarketDto
|
|
805
|
+
sdk.stellarLending.markets.detailed(...); // Array<StellarApi.StellarDetailedMarketDto>
|
|
796
806
|
|
|
797
807
|
// GET /stellar-lending/hubs
|
|
798
|
-
sdk.stellarLending.hubs(...); // StellarHubListItemDto
|
|
808
|
+
sdk.stellarLending.hubs(...); // Array<StellarApi.StellarHubListItemDto>
|
|
799
809
|
|
|
800
810
|
// GET /stellar-lending/spokes
|
|
801
|
-
sdk.stellarLending.spokes(...); // StellarSpokeListItemDto
|
|
811
|
+
sdk.stellarLending.spokes(...); // Array<StellarApi.StellarSpokeListItemDto>
|
|
802
812
|
|
|
803
813
|
// GET /stellar-lending/reserves
|
|
804
|
-
sdk.stellarLending.reserves(...); // StellarReserveListItemDto
|
|
814
|
+
sdk.stellarLending.reserves(...); // Array<StellarApi.StellarReserveListItemDto>
|
|
805
815
|
|
|
806
816
|
// GET /stellar-lending/reserves/:spokeId/:hubId/:asset
|
|
807
|
-
sdk.stellarLending.reserves.spokeId("...").hubId("...").asset("...")(...); // ReserveDto
|
|
817
|
+
sdk.stellarLending.reserves.spokeId("...").hubId("...").asset("...")(...); // StellarApi.ReserveDto
|
|
808
818
|
|
|
809
819
|
// GET /stellar-lending/reserves/:spokeId/:hubId/:asset/holders
|
|
810
|
-
sdk.stellarLending.reserves.spokeId("...").hubId("...").asset("...").holders(...); // TopHoldersDto
|
|
820
|
+
sdk.stellarLending.reserves.spokeId("...").hubId("...").asset("...").holders(...); // StellarApi.TopHoldersDto
|
|
811
821
|
|
|
812
822
|
// GET /stellar-lending/hubs/:hubId/holders
|
|
813
|
-
sdk.stellarLending.hubs.hubId("...").holders(...); // TopHoldersDto
|
|
823
|
+
sdk.stellarLending.hubs.hubId("...").holders(...); // StellarApi.TopHoldersDto
|
|
814
824
|
|
|
815
825
|
// GET /stellar-lending/spokes/:spokeId/holders
|
|
816
|
-
sdk.stellarLending.spokes.spokeId("...").holders(...); // TopHoldersDto
|
|
826
|
+
sdk.stellarLending.spokes.spokeId("...").holders(...); // StellarApi.TopHoldersDto
|
|
817
827
|
|
|
818
828
|
// GET /stellar-lending/assets/:asset
|
|
819
|
-
sdk.stellarLending.assets.asset("...")(...); // AssetDto
|
|
829
|
+
sdk.stellarLending.assets.asset("...")(...); // StellarApi.AssetDto
|
|
820
830
|
|
|
821
831
|
// GET /stellar-lending/assets/:asset/page
|
|
822
|
-
sdk.stellarLending.assets.asset("...").page(...); // AssetPageDto
|
|
832
|
+
sdk.stellarLending.assets.asset("...").page(...); // StellarApi.AssetPageDto
|
|
823
833
|
|
|
824
834
|
// GET /stellar-lending/assets/:asset/markets
|
|
825
|
-
sdk.stellarLending.assets.asset("...").markets(...); // AssetMarketDto
|
|
835
|
+
sdk.stellarLending.assets.asset("...").markets(...); // Array<StellarApi.AssetMarketDto>
|
|
826
836
|
|
|
827
837
|
// GET /stellar-lending/hubs/:hubId
|
|
828
|
-
sdk.stellarLending.hubs.hubId("...")(...); // HubDto
|
|
838
|
+
sdk.stellarLending.hubs.hubId("...")(...); // StellarApi.HubDto
|
|
829
839
|
|
|
830
840
|
// GET /stellar-lending/spokes/:spokeId
|
|
831
|
-
sdk.stellarLending.spokes.spokeId("...")(...); // SpokeDto
|
|
841
|
+
sdk.stellarLending.spokes.spokeId("...")(...); // StellarApi.SpokeDto
|
|
832
842
|
|
|
833
843
|
// GET /stellar-lending/users/:owner/positions
|
|
834
|
-
sdk.stellarLending.users.owner("...").positions(...); // AccountPositionsDto
|
|
844
|
+
sdk.stellarLending.users.owner("...").positions(...); // StellarApi.AccountPositionsDto
|
|
835
845
|
|
|
836
846
|
// GET /stellar-lending/users/:owner/activity
|
|
837
|
-
sdk.stellarLending.users.owner("...").activity(...); // StellarUserActivityItemDto
|
|
847
|
+
sdk.stellarLending.users.owner("...").activity(...); // Array<StellarApi.StellarUserActivityItemDto>
|
|
838
848
|
|
|
839
849
|
// GET /stellar-lending/accounts/:accountId/positions
|
|
840
|
-
sdk.stellarLending.accounts.accountId("...").positions(...); // AccountPositionsDto
|
|
850
|
+
sdk.stellarLending.accounts.accountId("...").positions(...); // StellarApi.AccountPositionsDto
|
|
841
851
|
|
|
842
852
|
// GET /stellar-lending/governance/proposals
|
|
843
|
-
sdk.stellarLending.governance.proposals(...); // GovernanceProposalsPageDto
|
|
853
|
+
sdk.stellarLending.governance.proposals(...); // StellarApi.GovernanceProposalsPageDto
|
|
844
854
|
|
|
845
855
|
// GET /stellar-lending/assets/:asset/graph
|
|
846
|
-
sdk.stellarLending.assets.asset("...").graph(...); // MarketGraphDto
|
|
856
|
+
sdk.stellarLending.assets.asset("...").graph(...); // StellarApi.MarketGraphDto
|
|
847
857
|
|
|
848
858
|
// GET /stellar-lending/hubs/:hubId/graph
|
|
849
|
-
sdk.stellarLending.hubs.hubId("...").graph(...); // MarketGraphDto
|
|
859
|
+
sdk.stellarLending.hubs.hubId("...").graph(...); // StellarApi.MarketGraphDto
|
|
850
860
|
|
|
851
861
|
// GET /stellar-lending/spokes/:spokeId/graph
|
|
852
|
-
sdk.stellarLending.spokes.spokeId("...").graph(...); // SpokeGraphDto
|
|
862
|
+
sdk.stellarLending.spokes.spokeId("...").graph(...); // StellarApi.SpokeGraphDto
|
|
853
863
|
|
|
854
864
|
// GET /stellar-lending/reserves/:spokeId/:hubId/:asset/graph
|
|
855
|
-
sdk.stellarLending.reserves.spokeId("...").hubId("...").asset("...").graph(...); // MarketGraphDto
|
|
865
|
+
sdk.stellarLending.reserves.spokeId("...").hubId("...").asset("...").graph(...); // StellarApi.MarketGraphDto
|
|
856
866
|
|
|
857
867
|
// GET /stellar-lending/stats/history
|
|
858
|
-
sdk.stellarLending.stats.history(...); // StellarStatsHistoryDto
|
|
868
|
+
sdk.stellarLending.stats.history(...); // StellarApi.StellarStatsHistoryDto
|
|
859
869
|
|
|
860
870
|
// GET /stellar-lending/pnl
|
|
861
|
-
sdk.stellarLending.pnl(...); // StellarPositionsPnlDto
|
|
871
|
+
sdk.stellarLending.pnl(...); // StellarApi.StellarPositionsPnlDto
|
|
862
872
|
|
|
863
873
|
// GET /stellar-lending/campaign/leaderboard
|
|
864
|
-
sdk.stellarLending.campaign.leaderboard(...); // StellarCampaignLeaderboardDto
|
|
874
|
+
sdk.stellarLending.campaign.leaderboard(...); // StellarApi.StellarCampaignLeaderboardDto
|
|
865
875
|
|
|
866
876
|
// GET /stellar-lending/campaign/me
|
|
867
|
-
sdk.stellarLending.campaign.me(...); // StellarCampaignMeDto
|
|
877
|
+
sdk.stellarLending.campaign.me(...); // StellarApi.StellarCampaignMeDto
|
|
868
878
|
|
|
869
879
|
// GET /stellar-lending/positions
|
|
870
|
-
sdk.stellarLending.positions(...); // StellarPositionsRankDto
|
|
880
|
+
sdk.stellarLending.positions(...); // StellarApi.StellarPositionsRankDto
|
|
871
881
|
|
|
872
882
|
// GET /stellar-lending/users/:accountId/history
|
|
873
|
-
sdk.stellarLending.users.accountId("...").history(...); // UserHistoryDto
|
|
883
|
+
sdk.stellarLending.users.accountId("...").history(...); // StellarApi.UserHistoryDto
|
|
874
884
|
|
|
875
885
|
// GET /stellar-lending/pnl/scope
|
|
876
|
-
sdk.stellarLending.pnl.scope(...); // PnlByScopeDto
|
|
886
|
+
sdk.stellarLending.pnl.scope(...); // StellarApi.PnlByScopeDto
|
|
877
887
|
|
|
878
888
|
// GET /stellar-lending/revenue
|
|
879
|
-
sdk.stellarLending.revenue(...); // RevenueSeriesDto
|
|
889
|
+
sdk.stellarLending.revenue(...); // StellarApi.RevenueSeriesDto
|
|
880
890
|
|
|
881
891
|
// GET /stellar-lending/revenue/fees
|
|
882
|
-
sdk.stellarLending.revenue.fees(...); // FeeRevenueSeriesDto
|
|
892
|
+
sdk.stellarLending.revenue.fees(...); // StellarApi.FeeRevenueSeriesDto
|
|
883
893
|
|
|
884
894
|
// GET /stellar-lending/participants
|
|
885
|
-
sdk.stellarLending.participants(...); // ParticipantCountsDto
|
|
895
|
+
sdk.stellarLending.participants(...); // StellarApi.ParticipantCountsDto
|
|
886
896
|
|
|
887
897
|
// GET /stellar-lending/liquidations
|
|
888
|
-
sdk.stellarLending.liquidations(...); // LiquidationsSeriesDto
|
|
898
|
+
sdk.stellarLending.liquidations(...); // StellarApi.LiquidationsSeriesDto
|
|
889
899
|
|
|
890
900
|
// GET /stellar-lending/liquidations/leaderboard
|
|
891
|
-
sdk.stellarLending.liquidations.leaderboard(...); // LiquidationsLeaderboardDto
|
|
901
|
+
sdk.stellarLending.liquidations.leaderboard(...); // StellarApi.LiquidationsLeaderboardDto
|
|
892
902
|
|
|
893
903
|
// GET /stellar-lending/volume
|
|
894
|
-
sdk.stellarLending.volume(...); // VolumeSeriesDto
|
|
904
|
+
sdk.stellarLending.volume(...); // StellarApi.VolumeSeriesDto
|
|
895
905
|
|
|
896
906
|
// GET /stellar-lending/active-users
|
|
897
|
-
sdk.stellarLending.activeUsers(...); // ActiveUsersSeriesDto
|
|
907
|
+
sdk.stellarLending.activeUsers(...); // StellarApi.ActiveUsersSeriesDto
|
|
898
908
|
|
|
899
909
|
// GET /stellar-lending/distribution
|
|
900
|
-
sdk.stellarLending.distribution(...); // HolderDistributionDto
|
|
910
|
+
sdk.stellarLending.distribution(...); // StellarApi.HolderDistributionDto
|
|
901
911
|
|
|
902
912
|
// GET /stellar-lending/rate-spread
|
|
903
|
-
sdk.stellarLending.rateSpread(...); // RateSpreadSeriesDto
|
|
913
|
+
sdk.stellarLending.rateSpread(...); // StellarApi.RateSpreadSeriesDto
|
|
904
914
|
|
|
905
915
|
// GET /stellar-lending/defillama
|
|
906
|
-
sdk.stellarLending.defillama(...); // DefiLlamaDimensionsDto
|
|
916
|
+
sdk.stellarLending.defillama(...); // StellarApi.DefiLlamaDimensionsDto
|
|
917
|
+
|
|
918
|
+
// GET /stellar-lending/users/:owner/assets/:asset/balance
|
|
919
|
+
sdk.stellarLending.users.owner("...").assets.asset("...").balance(...); // StellarApi.StellarWalletBalanceDto
|
|
920
|
+
|
|
921
|
+
// GET /stellar-lending/users/:owner/activity/page
|
|
922
|
+
sdk.stellarLending.users.owner("...").activity.page(...); // StellarApi.StellarActivityPageDto
|
|
907
923
|
|
|
908
924
|
// GET /tokens
|
|
909
925
|
sdk.tokens(...); // TokenDataDocHydrated[]
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './utils/api';
|
|
2
|
-
export * from './utils/regex';
|
|
3
|
-
export * from './sdk';
|
|
1
|
+
export * from './utils/api.js';
|
|
2
|
+
export * from './utils/regex.js';
|
|
3
|
+
export * from './sdk/index.js';
|
package/dist/cjs/sdk/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { XOXNOClient } from '../utils/api';
|
|
2
|
-
import type { SDK } from './types';
|
|
3
|
-
export * from './stellar';
|
|
4
|
-
export type { SDKTags } from './types';
|
|
1
|
+
import type { XOXNOClient } from '../utils/api.js';
|
|
2
|
+
import type { SDK } from './types.js';
|
|
3
|
+
export * from './stellar/index.js';
|
|
4
|
+
export type { SDKTags } from './types.js';
|
|
5
5
|
export declare function buildSdk(client: XOXNOClient): SDK;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { AssetOracleConfigInputDto, ConfigureAssetOracleArgsDto, EditOracleToleranceArgsDto, InterestRateModelDto, MarketParamsRawDto, PositionLimitsDto } from '@xoxno/types';
|
|
13
13
|
import type { StellarAssetOracle, StellarPriceKey } from '@xoxno/types/stellar-lending';
|
|
14
|
-
import { type BuiltStellarTx, type
|
|
14
|
+
import { type BuiltStellarTx, type StellarLendingBuilderOptions } from './lending.js';
|
|
15
15
|
import { xdr } from '@stellar/stellar-sdk';
|
|
16
16
|
/** `InterestRateModel` — 8 RAY rates + reserve factor bps. */
|
|
17
17
|
export declare const encodeInterestRateModel: (m: InterestRateModelDto) => xdr.ScVal;
|
|
@@ -60,50 +60,50 @@ export interface RewardEntry {
|
|
|
60
60
|
}
|
|
61
61
|
export interface UpdateAccountThresholdArgs {
|
|
62
62
|
hasRisks: boolean;
|
|
63
|
-
accountNonces: number
|
|
63
|
+
accountNonces: Array<number | string>;
|
|
64
64
|
}
|
|
65
65
|
/** upgrade(new_wasm_hash: BytesN<32>) */
|
|
66
|
-
export declare function buildStellarUpgradeControllerTx(opts:
|
|
66
|
+
export declare function buildStellarUpgradeControllerTx(opts: StellarLendingBuilderOptions, args: {
|
|
67
67
|
wasmHash: string;
|
|
68
68
|
}): BuiltStellarTx;
|
|
69
69
|
/** migrate(new_version: u32) */
|
|
70
|
-
export declare function buildStellarMigrateTx(opts:
|
|
70
|
+
export declare function buildStellarMigrateTx(opts: StellarLendingBuilderOptions, args: {
|
|
71
71
|
newVersion: number;
|
|
72
72
|
}): BuiltStellarTx;
|
|
73
73
|
/** pause() */
|
|
74
|
-
export declare function buildStellarPauseTx(opts:
|
|
74
|
+
export declare function buildStellarPauseTx(opts: StellarLendingBuilderOptions): BuiltStellarTx;
|
|
75
75
|
/** unpause() */
|
|
76
|
-
export declare function buildStellarUnpauseTx(opts:
|
|
76
|
+
export declare function buildStellarUnpauseTx(opts: StellarLendingBuilderOptions): BuiltStellarTx;
|
|
77
77
|
/** grant_role(account: Address, role: Symbol) */
|
|
78
|
-
export declare function buildStellarGrantRoleTx(opts:
|
|
78
|
+
export declare function buildStellarGrantRoleTx(opts: StellarLendingBuilderOptions, args: RoleGrantArgs): BuiltStellarTx;
|
|
79
79
|
/** revoke_role(account: Address, role: Symbol) */
|
|
80
|
-
export declare function buildStellarRevokeRoleTx(opts:
|
|
80
|
+
export declare function buildStellarRevokeRoleTx(opts: StellarLendingBuilderOptions, args: RoleGrantArgs): BuiltStellarTx;
|
|
81
81
|
/** transfer_ownership(new_owner: Address, live_until_ledger: u32) */
|
|
82
|
-
export declare function buildStellarTransferOwnershipTx(opts:
|
|
82
|
+
export declare function buildStellarTransferOwnershipTx(opts: StellarLendingBuilderOptions, args: TransferOwnershipArgs): BuiltStellarTx;
|
|
83
83
|
/** accept_ownership() */
|
|
84
|
-
export declare function buildStellarAcceptOwnershipTx(opts:
|
|
84
|
+
export declare function buildStellarAcceptOwnershipTx(opts: StellarLendingBuilderOptions): BuiltStellarTx;
|
|
85
85
|
/** set_swap_aggregator(addr: Address) — #[only_owner] */
|
|
86
|
-
export declare function buildStellarSetSwapAggregatorTx(opts:
|
|
86
|
+
export declare function buildStellarSetSwapAggregatorTx(opts: StellarLendingBuilderOptions, args: {
|
|
87
87
|
aggregator: string;
|
|
88
88
|
}): BuiltStellarTx;
|
|
89
89
|
/** set_price_aggregator(addr: Address) — #[only_owner] */
|
|
90
|
-
export declare function buildStellarSetPriceAggregatorTx(opts:
|
|
90
|
+
export declare function buildStellarSetPriceAggregatorTx(opts: StellarLendingBuilderOptions, args: {
|
|
91
91
|
aggregator: string;
|
|
92
92
|
}): BuiltStellarTx;
|
|
93
93
|
/** @deprecated Use buildStellarSetSwapAggregatorTx. */
|
|
94
94
|
export declare const buildStellarSetAggregatorTx: typeof buildStellarSetSwapAggregatorTx;
|
|
95
95
|
/** set_accumulator(addr: Address) — #[only_owner] */
|
|
96
|
-
export declare function buildStellarSetAccumulatorTx(opts:
|
|
96
|
+
export declare function buildStellarSetAccumulatorTx(opts: StellarLendingBuilderOptions, args: {
|
|
97
97
|
accumulator: string;
|
|
98
98
|
}): BuiltStellarTx;
|
|
99
99
|
/** set_position_limits(limits: PositionLimits) — #[only_owner] */
|
|
100
|
-
export declare function buildStellarSetPositionLimitsTx(opts:
|
|
100
|
+
export declare function buildStellarSetPositionLimitsTx(opts: StellarLendingBuilderOptions, args: PositionLimitsDto): BuiltStellarTx;
|
|
101
101
|
/** approve_blend_pool(pool: Address) — #[only_owner] */
|
|
102
|
-
export declare function buildStellarApproveBlendPoolTx(opts:
|
|
102
|
+
export declare function buildStellarApproveBlendPoolTx(opts: StellarLendingBuilderOptions, args: {
|
|
103
103
|
pool: string;
|
|
104
104
|
}): BuiltStellarTx;
|
|
105
105
|
/** revoke_blend_pool(pool: Address) — #[only_owner] */
|
|
106
|
-
export declare function buildStellarRevokeBlendPoolTx(opts:
|
|
106
|
+
export declare function buildStellarRevokeBlendPoolTx(opts: StellarLendingBuilderOptions, args: {
|
|
107
107
|
pool: string;
|
|
108
108
|
}): BuiltStellarTx;
|
|
109
109
|
/** @deprecated Use buildStellarApproveBlendPoolTx. */
|
|
@@ -115,11 +115,11 @@ export declare const buildStellarRevokeTokenTx: typeof buildStellarRevokeBlendPo
|
|
|
115
115
|
* contract address as tx source after deploy). Prefer governance propose path
|
|
116
116
|
* in production.
|
|
117
117
|
*/
|
|
118
|
-
export declare function buildStellarSetOracleTx(opts:
|
|
118
|
+
export declare function buildStellarSetOracleTx(opts: StellarLendingBuilderOptions, args: ConfigureAssetOracleArgs): BuiltStellarTx;
|
|
119
119
|
/** @deprecated Use buildStellarSetOracleTx. */
|
|
120
120
|
export declare const buildStellarSetMarketOracleConfigTx: typeof buildStellarSetOracleTx;
|
|
121
121
|
/** price-aggregator `set_tolerance(key, OracleTolerance)` — owner only. */
|
|
122
|
-
export declare function buildStellarSetOracleToleranceTx(opts:
|
|
122
|
+
export declare function buildStellarSetOracleToleranceTx(opts: StellarLendingBuilderOptions, args: EditOracleToleranceArgs & {
|
|
123
123
|
upperRatioBps?: number;
|
|
124
124
|
lowerRatioBps?: number;
|
|
125
125
|
}): BuiltStellarTx;
|
|
@@ -130,7 +130,7 @@ export declare function buildStellarSetOracleToleranceTx(opts: StellarBuilderOpt
|
|
|
130
130
|
* (`buildStellarGovernanceSetSpokeAssetFlagsImmediateTx`). Every flag is a
|
|
131
131
|
* one-way ratchet here: clearing one requires the timelocked spoke-asset edit.
|
|
132
132
|
*/
|
|
133
|
-
export declare function buildStellarSetSpokeAssetFlagsTx(opts:
|
|
133
|
+
export declare function buildStellarSetSpokeAssetFlagsTx(opts: StellarLendingBuilderOptions, args: {
|
|
134
134
|
spokeId: number;
|
|
135
135
|
hubId: number;
|
|
136
136
|
asset: string;
|
|
@@ -144,36 +144,36 @@ export declare function buildStellarSetSpokeAssetFlagsTx(opts: StellarBuilderOpt
|
|
|
144
144
|
* Band-only oracle edit; production callers route through the ORACLE-gated
|
|
145
145
|
* governance forwarder (`buildStellarGovernanceSetOracleSanityBoundsImmediateTx`).
|
|
146
146
|
*/
|
|
147
|
-
export declare function buildStellarSetOracleSanityBoundsTx(opts:
|
|
147
|
+
export declare function buildStellarSetOracleSanityBoundsTx(opts: StellarLendingBuilderOptions, args: {
|
|
148
148
|
asset: string;
|
|
149
149
|
minPriceWad: string;
|
|
150
150
|
maxPriceWad: string;
|
|
151
151
|
}): BuiltStellarTx;
|
|
152
152
|
/** update_indexes(caller, assets: Vec<HubAssetKey>) */
|
|
153
|
-
export declare function buildStellarUpdateIndexesTx(opts:
|
|
153
|
+
export declare function buildStellarUpdateIndexesTx(opts: StellarLendingBuilderOptions, args: {
|
|
154
154
|
assets: Array<{
|
|
155
155
|
hubId: number;
|
|
156
156
|
asset: string;
|
|
157
157
|
}>;
|
|
158
158
|
}): BuiltStellarTx;
|
|
159
159
|
/** renew_account(caller, account_id: u64) */
|
|
160
|
-
export declare function buildStellarRenewAccountTx(opts:
|
|
161
|
-
accountNonce: number;
|
|
160
|
+
export declare function buildStellarRenewAccountTx(opts: StellarLendingBuilderOptions, args: {
|
|
161
|
+
accountNonce: number | string;
|
|
162
162
|
}): BuiltStellarTx;
|
|
163
163
|
/** create_liquidity_pool(hub_id, asset, params: MarketParamsRaw) -> Address — #[only_owner] */
|
|
164
|
-
export declare function buildStellarCreateLiquidityPoolTx(opts:
|
|
164
|
+
export declare function buildStellarCreateLiquidityPoolTx(opts: StellarLendingBuilderOptions, args: CreateLiquidityPoolArgs): BuiltStellarTx;
|
|
165
165
|
/** upgrade_liquidity_pool_params(hub_asset: HubAssetKey, params) — #[only_owner] */
|
|
166
|
-
export declare function buildStellarUpgradeLiquidityPoolParamsTx(opts:
|
|
166
|
+
export declare function buildStellarUpgradeLiquidityPoolParamsTx(opts: StellarLendingBuilderOptions, args: UpgradeLiquidityPoolParamsArgs): BuiltStellarTx;
|
|
167
167
|
/** claim_revenue(caller, assets: Vec<HubAssetKey>) -> Vec<i128> */
|
|
168
|
-
export declare function buildStellarClaimRevenueTx(opts:
|
|
168
|
+
export declare function buildStellarClaimRevenueTx(opts: StellarLendingBuilderOptions, args: {
|
|
169
169
|
assets: Array<{
|
|
170
170
|
hubId: number;
|
|
171
171
|
asset: string;
|
|
172
172
|
}>;
|
|
173
173
|
}): BuiltStellarTx;
|
|
174
174
|
/** add_rewards(caller, rewards: Vec<(HubAssetKey, i128)>) */
|
|
175
|
-
export declare function buildStellarAddRewardsTx(opts:
|
|
175
|
+
export declare function buildStellarAddRewardsTx(opts: StellarLendingBuilderOptions, args: {
|
|
176
176
|
rewards: RewardEntry[];
|
|
177
177
|
}): BuiltStellarTx;
|
|
178
178
|
/** update_account_threshold(caller, asset, has_risks, account_ids: Vec<u64>) — #[only_role(caller, "KEEPER")] */
|
|
179
|
-
export declare function buildStellarUpdateAccountThresholdTx(opts:
|
|
179
|
+
export declare function buildStellarUpdateAccountThresholdTx(opts: StellarLendingBuilderOptions, args: UpdateAccountThresholdArgs): BuiltStellarTx;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type StellarNetwork } from './contracts';
|
|
2
|
-
import type { BuiltStellarTx, StellarBuilderOptions } from './lending';
|
|
1
|
+
import { type StellarNetwork } from './contracts.js';
|
|
2
|
+
import type { BuiltStellarTx, StellarBuilderOptions } from './lending.js';
|
|
3
3
|
export interface BuildStellarCctpForwardTxArgs extends StellarBuilderOptions {
|
|
4
4
|
forwarderAddress: string;
|
|
5
5
|
message: string;
|
|
@@ -1,70 +1,107 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stellar Soroban contract addresses + Soroban RPC + quote-server config
|
|
3
|
-
* per network.
|
|
4
|
-
*
|
|
5
|
-
* Addresses are env-sourced so ops can rotate mainnet/testnet deployments
|
|
6
|
-
* without a code change. Defaults fall back to empty strings so a missing
|
|
7
|
-
* env surfaces as a clear "not configured" error at call time rather than
|
|
8
|
-
* silently pointing at the wrong contract.
|
|
9
|
-
*/
|
|
1
|
+
/** Stellar network identifiers understood by the Soroban transaction builders. */
|
|
10
2
|
export type StellarNetwork = 'mainnet' | 'testnet';
|
|
3
|
+
/** Stable keys for the Stellar network deployment manifest. */
|
|
4
|
+
export type StellarNetworkId = 'stellarMainnet' | 'stellarTestnet';
|
|
11
5
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Stellar aggregator router contract addresses per network.
|
|
20
|
-
* Targets `execute_strategy(sender, total_in, swap_xdr)` for direct
|
|
21
|
-
* (non-lending) swaps.
|
|
22
|
-
* Env vars:
|
|
23
|
-
* - STELLAR_AGGREGATOR_ROUTER_MAINNET
|
|
24
|
-
* - STELLAR_AGGREGATOR_ROUTER_TESTNET
|
|
25
|
-
*/
|
|
26
|
-
export declare const STELLAR_AGGREGATOR_ROUTER: Record<StellarNetwork, string>;
|
|
27
|
-
/**
|
|
28
|
-
* Stellar governance (timelock) contract addresses per network. Owns the
|
|
29
|
-
* controller's admin surface: PROPOSER-gated `propose_*` scheduling and the
|
|
30
|
-
* open `execute` / `execute_*` lifecycle.
|
|
31
|
-
* Env vars:
|
|
32
|
-
* - STELLAR_GOVERNANCE_MAINNET
|
|
33
|
-
* - STELLAR_GOVERNANCE_TESTNET
|
|
34
|
-
*/
|
|
35
|
-
export declare const STELLAR_GOVERNANCE: Record<StellarNetwork, string>;
|
|
36
|
-
/**
|
|
37
|
-
* Default Soroban RPC URLs per network.
|
|
38
|
-
* Overridable at runtime via the `sorobanRpcUrl` option on each builder.
|
|
6
|
+
* Public XOXNO Stellar deployment metadata.
|
|
7
|
+
*
|
|
8
|
+
* The API URL is deliberately absent: it belongs to `XOXNOClientOptions` and
|
|
9
|
+
* may use a different host from the chain infrastructure. Consumers choose a
|
|
10
|
+
* manifest entry by network and may pass its addresses/URLs to their own
|
|
11
|
+
* transaction and RPC clients.
|
|
39
12
|
*/
|
|
40
|
-
export
|
|
13
|
+
export interface StellarDeployment {
|
|
14
|
+
readonly name: StellarNetwork;
|
|
15
|
+
readonly passphrase: string;
|
|
16
|
+
readonly horizonUrl: string;
|
|
17
|
+
readonly sorobanRpcUrl: string;
|
|
18
|
+
readonly quoteUrl: string;
|
|
19
|
+
readonly explorerNetwork: 'public' | 'testnet';
|
|
20
|
+
readonly aquariusApiUrl: string;
|
|
21
|
+
readonly aquariusRouter: string;
|
|
22
|
+
readonly lendingController: string;
|
|
23
|
+
readonly aggregatorRouter: string;
|
|
24
|
+
readonly governance: string;
|
|
25
|
+
readonly priceAggregator: string;
|
|
26
|
+
readonly positionNftContract: string;
|
|
27
|
+
}
|
|
41
28
|
/**
|
|
42
|
-
* Stellar
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* Env vars:
|
|
46
|
-
* - STELLAR_QUOTE_URL_MAINNET
|
|
47
|
-
* - STELLAR_QUOTE_URL_TESTNET
|
|
29
|
+
* XOXNO's supported Stellar deployments. Keep this table in the SDK so UI
|
|
30
|
+
* and integrators use the same network, RPC, quote-server, and contract IDs.
|
|
31
|
+
* It contains no environment or runtime discovery logic.
|
|
48
32
|
*/
|
|
49
|
-
export declare const
|
|
33
|
+
export declare const STELLAR_NETWORKS: {
|
|
34
|
+
readonly stellarMainnet: {
|
|
35
|
+
readonly name: "mainnet";
|
|
36
|
+
readonly passphrase: "Public Global Stellar Network ; September 2015";
|
|
37
|
+
readonly horizonUrl: "https://horizon.stellar.org";
|
|
38
|
+
readonly sorobanRpcUrl: "https://stellar-gateway.xoxno.com";
|
|
39
|
+
readonly quoteUrl: "https://stellar-swap.xoxno.com";
|
|
40
|
+
readonly explorerNetwork: "public";
|
|
41
|
+
readonly aquariusApiUrl: "https://amm-api.aqua.network";
|
|
42
|
+
readonly aquariusRouter: "CBQDHNBFBZYE4MKPWBSJOPIYLW4SFSXAXUTSXJN76GNKYVYPCKWC6QUK";
|
|
43
|
+
readonly lendingController: "CAUCMIN5KSXEVZ7NMXR3LZATGD5EFIEUI5XWTFLYRO2R5OTXI22WE5JX";
|
|
44
|
+
readonly aggregatorRouter: "CCVENFSVCBYDHVOACFZXMNNYVOZ3LKXPZYU5LUI4N7KTXOKRVYD7F3TR";
|
|
45
|
+
readonly governance: "CC44PEQW7HSEPKAZ5ZRPH2JS5M5KVJXCUBLJ2ZX4E3WCDKMNFILHC2AD";
|
|
46
|
+
readonly priceAggregator: "CBGUF2G2Q7HCVCWYISDXBHPVBGMYNXA7PG2VET66YBZX6IKOOV27NSMV";
|
|
47
|
+
readonly positionNftContract: "CAWCSG77AY2W24QZ6ZXLHZU4UXEFHZBM6EI4A4IF7JB5CTY4XND3TI6C";
|
|
48
|
+
};
|
|
49
|
+
readonly stellarTestnet: {
|
|
50
|
+
readonly name: "testnet";
|
|
51
|
+
readonly passphrase: "Test SDF Network ; September 2015";
|
|
52
|
+
readonly horizonUrl: "https://horizon-testnet.stellar.org";
|
|
53
|
+
readonly sorobanRpcUrl: "https://stellar-testnet-gateway.xoxno.com";
|
|
54
|
+
readonly quoteUrl: "https://testnet-stellar-swap.xoxno.com";
|
|
55
|
+
readonly explorerNetwork: "testnet";
|
|
56
|
+
readonly aquariusApiUrl: "https://amm-api-testnet.aqua.network";
|
|
57
|
+
readonly aquariusRouter: "CBCFTQSPDBAIZ6R6PJQKSQWKNKWH2QIV3I4J72SHWBIK3ADRRAM5A6GD";
|
|
58
|
+
readonly lendingController: "CCXRWJ6SIU2WPFEGLFGJVITPL57QAYIMIO6OAM2NBGNDQSSCK2FFV3F3";
|
|
59
|
+
readonly aggregatorRouter: "CDNTWMWW2WGYTKIZTJYNGNVQQZI4KTC5BQRZ3275KESRX5T4O3AYECL5";
|
|
60
|
+
readonly governance: "CDS33JDOYH3F3FL4QUQ6DV4WKHML2AKHF4LADTZ57FRUAEBTE7NMY5FQ";
|
|
61
|
+
readonly priceAggregator: "CAALOOTIDXCX7D7FMQIBSSAJLPKOM3GMXS4UUSTDIG42JCRRJHOPUHOP";
|
|
62
|
+
readonly positionNftContract: "CDVN5JU675MEDPVRPCYC45AHFC275UH57WEU5OTFE4WFGZBNN7HTLPSY";
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
/** Lowercase alias for consumers that prefer the UI's existing naming. */
|
|
66
|
+
export declare const stellarNetworks: {
|
|
67
|
+
readonly stellarMainnet: {
|
|
68
|
+
readonly name: "mainnet";
|
|
69
|
+
readonly passphrase: "Public Global Stellar Network ; September 2015";
|
|
70
|
+
readonly horizonUrl: "https://horizon.stellar.org";
|
|
71
|
+
readonly sorobanRpcUrl: "https://stellar-gateway.xoxno.com";
|
|
72
|
+
readonly quoteUrl: "https://stellar-swap.xoxno.com";
|
|
73
|
+
readonly explorerNetwork: "public";
|
|
74
|
+
readonly aquariusApiUrl: "https://amm-api.aqua.network";
|
|
75
|
+
readonly aquariusRouter: "CBQDHNBFBZYE4MKPWBSJOPIYLW4SFSXAXUTSXJN76GNKYVYPCKWC6QUK";
|
|
76
|
+
readonly lendingController: "CAUCMIN5KSXEVZ7NMXR3LZATGD5EFIEUI5XWTFLYRO2R5OTXI22WE5JX";
|
|
77
|
+
readonly aggregatorRouter: "CCVENFSVCBYDHVOACFZXMNNYVOZ3LKXPZYU5LUI4N7KTXOKRVYD7F3TR";
|
|
78
|
+
readonly governance: "CC44PEQW7HSEPKAZ5ZRPH2JS5M5KVJXCUBLJ2ZX4E3WCDKMNFILHC2AD";
|
|
79
|
+
readonly priceAggregator: "CBGUF2G2Q7HCVCWYISDXBHPVBGMYNXA7PG2VET66YBZX6IKOOV27NSMV";
|
|
80
|
+
readonly positionNftContract: "CAWCSG77AY2W24QZ6ZXLHZU4UXEFHZBM6EI4A4IF7JB5CTY4XND3TI6C";
|
|
81
|
+
};
|
|
82
|
+
readonly stellarTestnet: {
|
|
83
|
+
readonly name: "testnet";
|
|
84
|
+
readonly passphrase: "Test SDF Network ; September 2015";
|
|
85
|
+
readonly horizonUrl: "https://horizon-testnet.stellar.org";
|
|
86
|
+
readonly sorobanRpcUrl: "https://stellar-testnet-gateway.xoxno.com";
|
|
87
|
+
readonly quoteUrl: "https://testnet-stellar-swap.xoxno.com";
|
|
88
|
+
readonly explorerNetwork: "testnet";
|
|
89
|
+
readonly aquariusApiUrl: "https://amm-api-testnet.aqua.network";
|
|
90
|
+
readonly aquariusRouter: "CBCFTQSPDBAIZ6R6PJQKSQWKNKWH2QIV3I4J72SHWBIK3ADRRAM5A6GD";
|
|
91
|
+
readonly lendingController: "CCXRWJ6SIU2WPFEGLFGJVITPL57QAYIMIO6OAM2NBGNDQSSCK2FFV3F3";
|
|
92
|
+
readonly aggregatorRouter: "CDNTWMWW2WGYTKIZTJYNGNVQQZI4KTC5BQRZ3275KESRX5T4O3AYECL5";
|
|
93
|
+
readonly governance: "CDS33JDOYH3F3FL4QUQ6DV4WKHML2AKHF4LADTZ57FRUAEBTE7NMY5FQ";
|
|
94
|
+
readonly priceAggregator: "CAALOOTIDXCX7D7FMQIBSSAJLPKOM3GMXS4UUSTDIG42JCRRJHOPUHOP";
|
|
95
|
+
readonly positionNftContract: "CDVN5JU675MEDPVRPCYC45AHFC275UH57WEU5OTFE4WFGZBNN7HTLPSY";
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
/** Resolve a deployment from the network name used by transaction builders. */
|
|
99
|
+
export declare function getStellarDeployment(network: StellarNetwork): StellarDeployment;
|
|
50
100
|
/**
|
|
51
101
|
* Stellar network passphrases (Soroban tx signing domain separator).
|
|
52
102
|
* These are fixed by the Stellar network itself and must not be overridden.
|
|
53
103
|
*/
|
|
54
|
-
export declare const STELLAR_NETWORK_PASSPHRASE:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
* points at `""`.
|
|
59
|
-
*/
|
|
60
|
-
export declare function getStellarLendingController(network: StellarNetwork): string;
|
|
61
|
-
/**
|
|
62
|
-
* Assert an aggregator router address is configured for the target network.
|
|
63
|
-
* Used by `buildStellarExecuteStrategyTx` for direct user -> router swaps.
|
|
64
|
-
*/
|
|
65
|
-
export declare function getStellarAggregatorRouter(network: StellarNetwork): string;
|
|
66
|
-
/**
|
|
67
|
-
* Assert a governance address is configured for the target network. Used by
|
|
68
|
-
* the governance `propose_*` / `execute` / `execute_*` builders.
|
|
69
|
-
*/
|
|
70
|
-
export declare function getStellarGovernance(network: StellarNetwork): string;
|
|
104
|
+
export declare const STELLAR_NETWORK_PASSPHRASE: {
|
|
105
|
+
readonly mainnet: "Public Global Stellar Network ; September 2015";
|
|
106
|
+
readonly testnet: "Test SDF Network ; September 2015";
|
|
107
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './decode';
|
|
2
|
-
export * from './id';
|
|
1
|
+
export * from './decode.js';
|
|
2
|
+
export * from './id.js';
|