@xoxno/sdk-js 1.0.212 → 1.0.214
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 +73 -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 +96 -51
- package/dist/cjs/sdk/types.d.ts +2 -2
- package/dist/cjs/utils/api.d.ts +14 -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 +96 -51
- package/dist/sdk/types.d.ts +2 -2
- package/dist/utils/api.d.ts +14 -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
|
|
|
@@ -506,9 +516,24 @@ sdk.faucet.POST(...); // SuccessDto
|
|
|
506
516
|
// GET /hatom/user/:address
|
|
507
517
|
sdk.hatom.user.address("...")(...); // UserInfo
|
|
508
518
|
|
|
519
|
+
// GET /integrations/liquid-staking/multiversx/revenue
|
|
520
|
+
sdk.integrations.liquidStaking.multiversx.revenue(...); // EgldLiquidStakingRevenueExport
|
|
521
|
+
|
|
509
522
|
// GET /integrations/lending/stellar
|
|
510
523
|
sdk.integrations.lending.stellar(...); // DefillamaLendingExport
|
|
511
524
|
|
|
525
|
+
// GET /integrations/lending/multiversx
|
|
526
|
+
sdk.integrations.lending.multiversx(...); // MvxDefillamaExport
|
|
527
|
+
|
|
528
|
+
// GET /integrations/lending/multiversx/revenue
|
|
529
|
+
sdk.integrations.lending.multiversx.revenue(...); // MvxRevenueExport
|
|
530
|
+
|
|
531
|
+
// GET /integrations/lending/multiversx/liquidations
|
|
532
|
+
sdk.integrations.lending.multiversx.liquidations(...); // MvxLiquidationsExport
|
|
533
|
+
|
|
534
|
+
// GET /integrations/lending/multiversx/active-users
|
|
535
|
+
sdk.integrations.lending.multiversx.activeUsers(...); // MvxUserStatsExport
|
|
536
|
+
|
|
512
537
|
// GET /integrations/lending/stellar/history
|
|
513
538
|
sdk.integrations.lending.stellar.history(...); // DefillamaLendingHistoryExport
|
|
514
539
|
|
|
@@ -768,127 +793,133 @@ sdk.stellar.tokens(...); // TokenDataDocHydrated[]
|
|
|
768
793
|
sdk.stellar.aggregator.quote(...); // SoroswapQuoteResponseDto
|
|
769
794
|
|
|
770
795
|
// GET /stellar-lending/assets
|
|
771
|
-
sdk.stellarLending.assets(...); // StellarAssetListItemDto
|
|
796
|
+
sdk.stellarLending.assets(...); // Array<StellarApi.StellarAssetListItemDto>
|
|
772
797
|
|
|
773
798
|
// GET /stellar-lending/context
|
|
774
|
-
sdk.stellarLending.context(...); // StellarLendingContextDto
|
|
799
|
+
sdk.stellarLending.context(...); // StellarApi.StellarLendingContextDto
|
|
775
800
|
|
|
776
801
|
// GET /stellar-lending/live-state
|
|
777
|
-
sdk.stellarLending.liveState(...); // StellarLendingLiveStateDto
|
|
802
|
+
sdk.stellarLending.liveState(...); // StellarApi.StellarLendingLiveStateDto
|
|
778
803
|
|
|
779
804
|
// GET /stellar-lending/markets/detailed
|
|
780
|
-
sdk.stellarLending.markets.detailed(...); // StellarDetailedMarketDto
|
|
805
|
+
sdk.stellarLending.markets.detailed(...); // Array<StellarApi.StellarDetailedMarketDto>
|
|
781
806
|
|
|
782
807
|
// GET /stellar-lending/hubs
|
|
783
|
-
sdk.stellarLending.hubs(...); // StellarHubListItemDto
|
|
808
|
+
sdk.stellarLending.hubs(...); // Array<StellarApi.StellarHubListItemDto>
|
|
784
809
|
|
|
785
810
|
// GET /stellar-lending/spokes
|
|
786
|
-
sdk.stellarLending.spokes(...); // StellarSpokeListItemDto
|
|
811
|
+
sdk.stellarLending.spokes(...); // Array<StellarApi.StellarSpokeListItemDto>
|
|
787
812
|
|
|
788
813
|
// GET /stellar-lending/reserves
|
|
789
|
-
sdk.stellarLending.reserves(...); // StellarReserveListItemDto
|
|
814
|
+
sdk.stellarLending.reserves(...); // Array<StellarApi.StellarReserveListItemDto>
|
|
790
815
|
|
|
791
816
|
// GET /stellar-lending/reserves/:spokeId/:hubId/:asset
|
|
792
|
-
sdk.stellarLending.reserves.spokeId("...").hubId("...").asset("...")(...); // ReserveDto
|
|
817
|
+
sdk.stellarLending.reserves.spokeId("...").hubId("...").asset("...")(...); // StellarApi.ReserveDto
|
|
793
818
|
|
|
794
819
|
// GET /stellar-lending/reserves/:spokeId/:hubId/:asset/holders
|
|
795
|
-
sdk.stellarLending.reserves.spokeId("...").hubId("...").asset("...").holders(...); // TopHoldersDto
|
|
820
|
+
sdk.stellarLending.reserves.spokeId("...").hubId("...").asset("...").holders(...); // StellarApi.TopHoldersDto
|
|
796
821
|
|
|
797
822
|
// GET /stellar-lending/hubs/:hubId/holders
|
|
798
|
-
sdk.stellarLending.hubs.hubId("...").holders(...); // TopHoldersDto
|
|
823
|
+
sdk.stellarLending.hubs.hubId("...").holders(...); // StellarApi.TopHoldersDto
|
|
799
824
|
|
|
800
825
|
// GET /stellar-lending/spokes/:spokeId/holders
|
|
801
|
-
sdk.stellarLending.spokes.spokeId("...").holders(...); // TopHoldersDto
|
|
826
|
+
sdk.stellarLending.spokes.spokeId("...").holders(...); // StellarApi.TopHoldersDto
|
|
802
827
|
|
|
803
828
|
// GET /stellar-lending/assets/:asset
|
|
804
|
-
sdk.stellarLending.assets.asset("...")(...); // AssetDto
|
|
829
|
+
sdk.stellarLending.assets.asset("...")(...); // StellarApi.AssetDto
|
|
805
830
|
|
|
806
831
|
// GET /stellar-lending/assets/:asset/page
|
|
807
|
-
sdk.stellarLending.assets.asset("...").page(...); // AssetPageDto
|
|
832
|
+
sdk.stellarLending.assets.asset("...").page(...); // StellarApi.AssetPageDto
|
|
808
833
|
|
|
809
834
|
// GET /stellar-lending/assets/:asset/markets
|
|
810
|
-
sdk.stellarLending.assets.asset("...").markets(...); // AssetMarketDto
|
|
835
|
+
sdk.stellarLending.assets.asset("...").markets(...); // Array<StellarApi.AssetMarketDto>
|
|
811
836
|
|
|
812
837
|
// GET /stellar-lending/hubs/:hubId
|
|
813
|
-
sdk.stellarLending.hubs.hubId("...")(...); // HubDto
|
|
838
|
+
sdk.stellarLending.hubs.hubId("...")(...); // StellarApi.HubDto
|
|
814
839
|
|
|
815
840
|
// GET /stellar-lending/spokes/:spokeId
|
|
816
|
-
sdk.stellarLending.spokes.spokeId("...")(...); // SpokeDto
|
|
841
|
+
sdk.stellarLending.spokes.spokeId("...")(...); // StellarApi.SpokeDto
|
|
817
842
|
|
|
818
843
|
// GET /stellar-lending/users/:owner/positions
|
|
819
|
-
sdk.stellarLending.users.owner("...").positions(...); // AccountPositionsDto
|
|
844
|
+
sdk.stellarLending.users.owner("...").positions(...); // StellarApi.AccountPositionsDto
|
|
820
845
|
|
|
821
846
|
// GET /stellar-lending/users/:owner/activity
|
|
822
|
-
sdk.stellarLending.users.owner("...").activity(...); // StellarUserActivityItemDto
|
|
847
|
+
sdk.stellarLending.users.owner("...").activity(...); // Array<StellarApi.StellarUserActivityItemDto>
|
|
823
848
|
|
|
824
849
|
// GET /stellar-lending/accounts/:accountId/positions
|
|
825
|
-
sdk.stellarLending.accounts.accountId("...").positions(...); // AccountPositionsDto
|
|
850
|
+
sdk.stellarLending.accounts.accountId("...").positions(...); // StellarApi.AccountPositionsDto
|
|
826
851
|
|
|
827
852
|
// GET /stellar-lending/governance/proposals
|
|
828
|
-
sdk.stellarLending.governance.proposals(...); // GovernanceProposalsPageDto
|
|
853
|
+
sdk.stellarLending.governance.proposals(...); // StellarApi.GovernanceProposalsPageDto
|
|
829
854
|
|
|
830
855
|
// GET /stellar-lending/assets/:asset/graph
|
|
831
|
-
sdk.stellarLending.assets.asset("...").graph(...); // MarketGraphDto
|
|
856
|
+
sdk.stellarLending.assets.asset("...").graph(...); // StellarApi.MarketGraphDto
|
|
832
857
|
|
|
833
858
|
// GET /stellar-lending/hubs/:hubId/graph
|
|
834
|
-
sdk.stellarLending.hubs.hubId("...").graph(...); // MarketGraphDto
|
|
859
|
+
sdk.stellarLending.hubs.hubId("...").graph(...); // StellarApi.MarketGraphDto
|
|
835
860
|
|
|
836
861
|
// GET /stellar-lending/spokes/:spokeId/graph
|
|
837
|
-
sdk.stellarLending.spokes.spokeId("...").graph(...); // SpokeGraphDto
|
|
862
|
+
sdk.stellarLending.spokes.spokeId("...").graph(...); // StellarApi.SpokeGraphDto
|
|
838
863
|
|
|
839
864
|
// GET /stellar-lending/reserves/:spokeId/:hubId/:asset/graph
|
|
840
|
-
sdk.stellarLending.reserves.spokeId("...").hubId("...").asset("...").graph(...); // MarketGraphDto
|
|
865
|
+
sdk.stellarLending.reserves.spokeId("...").hubId("...").asset("...").graph(...); // StellarApi.MarketGraphDto
|
|
841
866
|
|
|
842
867
|
// GET /stellar-lending/stats/history
|
|
843
|
-
sdk.stellarLending.stats.history(...); // StellarStatsHistoryDto
|
|
868
|
+
sdk.stellarLending.stats.history(...); // StellarApi.StellarStatsHistoryDto
|
|
844
869
|
|
|
845
870
|
// GET /stellar-lending/pnl
|
|
846
|
-
sdk.stellarLending.pnl(...); // StellarPositionsPnlDto
|
|
871
|
+
sdk.stellarLending.pnl(...); // StellarApi.StellarPositionsPnlDto
|
|
847
872
|
|
|
848
873
|
// GET /stellar-lending/campaign/leaderboard
|
|
849
|
-
sdk.stellarLending.campaign.leaderboard(...); // StellarCampaignLeaderboardDto
|
|
874
|
+
sdk.stellarLending.campaign.leaderboard(...); // StellarApi.StellarCampaignLeaderboardDto
|
|
850
875
|
|
|
851
876
|
// GET /stellar-lending/campaign/me
|
|
852
|
-
sdk.stellarLending.campaign.me(...); // StellarCampaignMeDto
|
|
877
|
+
sdk.stellarLending.campaign.me(...); // StellarApi.StellarCampaignMeDto
|
|
853
878
|
|
|
854
879
|
// GET /stellar-lending/positions
|
|
855
|
-
sdk.stellarLending.positions(...); // StellarPositionsRankDto
|
|
880
|
+
sdk.stellarLending.positions(...); // StellarApi.StellarPositionsRankDto
|
|
856
881
|
|
|
857
882
|
// GET /stellar-lending/users/:accountId/history
|
|
858
|
-
sdk.stellarLending.users.accountId("...").history(...); // UserHistoryDto
|
|
883
|
+
sdk.stellarLending.users.accountId("...").history(...); // StellarApi.UserHistoryDto
|
|
859
884
|
|
|
860
885
|
// GET /stellar-lending/pnl/scope
|
|
861
|
-
sdk.stellarLending.pnl.scope(...); // PnlByScopeDto
|
|
886
|
+
sdk.stellarLending.pnl.scope(...); // StellarApi.PnlByScopeDto
|
|
862
887
|
|
|
863
888
|
// GET /stellar-lending/revenue
|
|
864
|
-
sdk.stellarLending.revenue(...); // RevenueSeriesDto
|
|
889
|
+
sdk.stellarLending.revenue(...); // StellarApi.RevenueSeriesDto
|
|
865
890
|
|
|
866
891
|
// GET /stellar-lending/revenue/fees
|
|
867
|
-
sdk.stellarLending.revenue.fees(...); // FeeRevenueSeriesDto
|
|
892
|
+
sdk.stellarLending.revenue.fees(...); // StellarApi.FeeRevenueSeriesDto
|
|
868
893
|
|
|
869
894
|
// GET /stellar-lending/participants
|
|
870
|
-
sdk.stellarLending.participants(...); // ParticipantCountsDto
|
|
895
|
+
sdk.stellarLending.participants(...); // StellarApi.ParticipantCountsDto
|
|
871
896
|
|
|
872
897
|
// GET /stellar-lending/liquidations
|
|
873
|
-
sdk.stellarLending.liquidations(...); // LiquidationsSeriesDto
|
|
898
|
+
sdk.stellarLending.liquidations(...); // StellarApi.LiquidationsSeriesDto
|
|
874
899
|
|
|
875
900
|
// GET /stellar-lending/liquidations/leaderboard
|
|
876
|
-
sdk.stellarLending.liquidations.leaderboard(...); // LiquidationsLeaderboardDto
|
|
901
|
+
sdk.stellarLending.liquidations.leaderboard(...); // StellarApi.LiquidationsLeaderboardDto
|
|
877
902
|
|
|
878
903
|
// GET /stellar-lending/volume
|
|
879
|
-
sdk.stellarLending.volume(...); // VolumeSeriesDto
|
|
904
|
+
sdk.stellarLending.volume(...); // StellarApi.VolumeSeriesDto
|
|
880
905
|
|
|
881
906
|
// GET /stellar-lending/active-users
|
|
882
|
-
sdk.stellarLending.activeUsers(...); // ActiveUsersSeriesDto
|
|
907
|
+
sdk.stellarLending.activeUsers(...); // StellarApi.ActiveUsersSeriesDto
|
|
883
908
|
|
|
884
909
|
// GET /stellar-lending/distribution
|
|
885
|
-
sdk.stellarLending.distribution(...); // HolderDistributionDto
|
|
910
|
+
sdk.stellarLending.distribution(...); // StellarApi.HolderDistributionDto
|
|
886
911
|
|
|
887
912
|
// GET /stellar-lending/rate-spread
|
|
888
|
-
sdk.stellarLending.rateSpread(...); // RateSpreadSeriesDto
|
|
913
|
+
sdk.stellarLending.rateSpread(...); // StellarApi.RateSpreadSeriesDto
|
|
889
914
|
|
|
890
915
|
// GET /stellar-lending/defillama
|
|
891
|
-
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
|
|
892
923
|
|
|
893
924
|
// GET /tokens
|
|
894
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';
|