@dfns/sdk 0.7.14 → 0.7.15-rc.0
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/generated/auth/client.d.ts +2 -2
- package/generated/auth/client.js +2 -2
- package/generated/auth/delegatedClient.d.ts +2 -2
- package/generated/auth/delegatedClient.js +2 -2
- package/generated/auth/types.d.ts +9 -8
- package/generated/feeSponsors/types.d.ts +51 -4
- package/generated/keys/types.d.ts +7 -7
- package/generated/permissions/types.d.ts +2 -2
- package/generated/policies/types.d.ts +30 -18
- package/generated/signers/types.d.ts +1 -0
- package/generated/swaps/types.d.ts +6 -6
- package/generated/wallets/types.d.ts +23 -7
- package/generated/yields/client.d.ts +11 -0
- package/generated/yields/client.js +70 -0
- package/generated/yields/delegatedClient.d.ts +14 -0
- package/generated/yields/delegatedClient.js +99 -0
- package/generated/yields/index.d.ts +3 -0
- package/generated/yields/index.js +19 -0
- package/generated/yields/types.d.ts +488 -0
- package/generated/yields/types.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DelegatedYieldsClient = void 0;
|
|
4
|
+
const baseAuthApi_1 = require("../../baseAuthApi");
|
|
5
|
+
const fetch_1 = require("../../utils/fetch");
|
|
6
|
+
const url_1 = require("../../utils/url");
|
|
7
|
+
class DelegatedYieldsClient {
|
|
8
|
+
constructor(apiOptions) {
|
|
9
|
+
this.apiOptions = apiOptions;
|
|
10
|
+
}
|
|
11
|
+
async createYieldInit(request) {
|
|
12
|
+
const path = (0, url_1.buildPathAndQuery)('/yields', {
|
|
13
|
+
path: request ?? {},
|
|
14
|
+
query: {},
|
|
15
|
+
});
|
|
16
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
17
|
+
userActionHttpMethod: 'POST',
|
|
18
|
+
userActionHttpPath: path,
|
|
19
|
+
userActionPayload: JSON.stringify(request.body),
|
|
20
|
+
userActionServerKind: 'Api',
|
|
21
|
+
}, this.apiOptions);
|
|
22
|
+
return challenge;
|
|
23
|
+
}
|
|
24
|
+
async createYieldComplete(request, signedChallenge) {
|
|
25
|
+
const path = (0, url_1.buildPathAndQuery)('/yields', {
|
|
26
|
+
path: request ?? {},
|
|
27
|
+
query: {},
|
|
28
|
+
});
|
|
29
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
30
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
31
|
+
method: 'POST',
|
|
32
|
+
body: request.body,
|
|
33
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
34
|
+
apiOptions: this.apiOptions,
|
|
35
|
+
});
|
|
36
|
+
return response.json();
|
|
37
|
+
}
|
|
38
|
+
async createYieldActionInit(request) {
|
|
39
|
+
const path = (0, url_1.buildPathAndQuery)('/yields/:yieldId/actions', {
|
|
40
|
+
path: request ?? {},
|
|
41
|
+
query: {},
|
|
42
|
+
});
|
|
43
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
44
|
+
userActionHttpMethod: 'POST',
|
|
45
|
+
userActionHttpPath: path,
|
|
46
|
+
userActionPayload: JSON.stringify(request.body),
|
|
47
|
+
userActionServerKind: 'Api',
|
|
48
|
+
}, this.apiOptions);
|
|
49
|
+
return challenge;
|
|
50
|
+
}
|
|
51
|
+
async createYieldActionComplete(request, signedChallenge) {
|
|
52
|
+
const path = (0, url_1.buildPathAndQuery)('/yields/:yieldId/actions', {
|
|
53
|
+
path: request ?? {},
|
|
54
|
+
query: {},
|
|
55
|
+
});
|
|
56
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
57
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
58
|
+
method: 'POST',
|
|
59
|
+
body: request.body,
|
|
60
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
61
|
+
apiOptions: this.apiOptions,
|
|
62
|
+
});
|
|
63
|
+
return response.json();
|
|
64
|
+
}
|
|
65
|
+
async getYield(request) {
|
|
66
|
+
const path = (0, url_1.buildPathAndQuery)('/yields/:yieldId', {
|
|
67
|
+
path: request ?? {},
|
|
68
|
+
query: {},
|
|
69
|
+
});
|
|
70
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
71
|
+
method: 'GET',
|
|
72
|
+
apiOptions: this.apiOptions,
|
|
73
|
+
});
|
|
74
|
+
return response.json();
|
|
75
|
+
}
|
|
76
|
+
async listYieldActions(request) {
|
|
77
|
+
const path = (0, url_1.buildPathAndQuery)('/yields/:yieldId/actions', {
|
|
78
|
+
path: request ?? {},
|
|
79
|
+
query: request.query ?? {},
|
|
80
|
+
});
|
|
81
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
82
|
+
method: 'GET',
|
|
83
|
+
apiOptions: this.apiOptions,
|
|
84
|
+
});
|
|
85
|
+
return response.json();
|
|
86
|
+
}
|
|
87
|
+
async listYields(request) {
|
|
88
|
+
const path = (0, url_1.buildPathAndQuery)('/yields', {
|
|
89
|
+
path: request ?? {},
|
|
90
|
+
query: request?.query ?? {},
|
|
91
|
+
});
|
|
92
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
93
|
+
method: 'GET',
|
|
94
|
+
apiOptions: this.apiOptions,
|
|
95
|
+
});
|
|
96
|
+
return response.json();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.DelegatedYieldsClient = DelegatedYieldsClient;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./client"), exports);
|
|
19
|
+
__exportStar(require("./delegatedClient"), exports);
|
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
export type CreateYieldBody = {
|
|
2
|
+
/** Wallet id. */
|
|
3
|
+
walletId: string;
|
|
4
|
+
/** Ofns protocol */
|
|
5
|
+
protocol: "0fns";
|
|
6
|
+
/** An optional external identifier provided by the client to ensure idempotency and prevent duplicate operations. */
|
|
7
|
+
externalId?: string | undefined;
|
|
8
|
+
sourceAsset: {
|
|
9
|
+
kind: "Erc20";
|
|
10
|
+
contract: string;
|
|
11
|
+
amount: string;
|
|
12
|
+
};
|
|
13
|
+
targetAsset: {
|
|
14
|
+
kind: "Erc20";
|
|
15
|
+
contract: string;
|
|
16
|
+
amount: string;
|
|
17
|
+
};
|
|
18
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you're willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. */
|
|
19
|
+
slippageBps: number;
|
|
20
|
+
};
|
|
21
|
+
export type CreateYieldResponse = {
|
|
22
|
+
/** Unique identifier for the yield investment. */
|
|
23
|
+
id: string;
|
|
24
|
+
/** Wallet id. */
|
|
25
|
+
walletId: string;
|
|
26
|
+
/** The DeFi protocol used for yield generation. Currently supports OFNS protocol */
|
|
27
|
+
protocol: "0fns";
|
|
28
|
+
/** The total amount currently invested in this yield. */
|
|
29
|
+
amount: ({
|
|
30
|
+
kind: "Native";
|
|
31
|
+
amount: string;
|
|
32
|
+
} | {
|
|
33
|
+
kind: "Erc20";
|
|
34
|
+
contract: string;
|
|
35
|
+
amount: string;
|
|
36
|
+
}) & {
|
|
37
|
+
metadata: {
|
|
38
|
+
network: "Algorand" | "AlgorandTestnet" | "Aptos" | "AptosTestnet" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Adi" | "AdiTestnet" | "BabylonGenesis" | "BabylonTestnet5" | "Base" | "BaseGoerli" | "BaseSepolia" | "Berachain" | "BerachainBArtio" | "BerachainBepolia" | "Bitcoin" | "BitcoinSignet" | "BitcoinTestnet3" | "BitcoinCash" | "BitcoinCashTestnet" | "Bob" | "BobSepolia" | "Bsc" | "BscTestnet" | "Canton" | "CantonDevnet" | "CantonTestnet" | "Cardano" | "CardanoPreprod" | "Celo" | "CeloAlfajores" | "Codex" | "CodexSepolia" | "CosmosHub4" | "CosmosIcsTestnet" | "Dogecoin" | "DogecoinTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "EthereumHoodi" | "FantomOpera" | "FantomTestnet" | "FlareC" | "FlareCCoston2" | "Hedera" | "HederaTestnet" | "Ink" | "InkSepolia" | "InternetComputer" | "Ion" | "IonTestnet" | "Iota" | "IotaTestnet" | "IotaZodianet" | "KadenaTestnet4" | "KadenaTestnet4:1" | "KadenaTestnet4:2" | "KadenaTestnet4:3" | "KadenaTestnet4:4" | "KadenaTestnet4:5" | "KadenaTestnet4:6" | "KadenaTestnet4:7" | "KadenaTestnet4:8" | "KadenaTestnet4:9" | "KadenaTestnet4:10" | "KadenaTestnet4:11" | "KadenaTestnet4:12" | "KadenaTestnet4:13" | "KadenaTestnet4:14" | "KadenaTestnet4:15" | "KadenaTestnet4:16" | "KadenaTestnet4:17" | "KadenaTestnet4:18" | "KadenaTestnet4:19" | "Kadena" | "Kadena:1" | "Kadena:2" | "Kadena:3" | "Kadena:4" | "Kadena:5" | "Kadena:6" | "Kadena:7" | "Kadena:8" | "Kadena:9" | "Kadena:10" | "Kadena:11" | "Kadena:12" | "Kadena:13" | "Kadena:14" | "Kadena:15" | "Kadena:16" | "Kadena:17" | "Kadena:18" | "Kadena:19" | "Kaspa" | "KaspaTestnet11" | "Kusama" | "Litecoin" | "LitecoinTestnet" | "Near" | "NearTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Origyn" | "Plume" | "PlumeSepolia" | "Polkadot" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Polymesh" | "PolymeshTestnet" | "Race" | "RaceSepolia" | "SeiAtlantic2" | "SeiPacific1" | "Solana" | "SolanaDevnet" | "Sonic" | "SonicTestnet" | "Stellar" | "StellarTestnet" | "Sui" | "SuiTestnet" | "Tsc" | "TscTestnet1" | "Tezos" | "TezosGhostnet" | "Ton" | "TonTestnet" | "Tron" | "TronNile" | "Westend" | "XrpLedger" | "XrpLedgerTestnet";
|
|
39
|
+
name?: string | undefined;
|
|
40
|
+
symbol?: string | undefined;
|
|
41
|
+
decimals: number;
|
|
42
|
+
tid?: string | undefined;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/** The total interest earned so far in this yield. */
|
|
46
|
+
rewards: ({
|
|
47
|
+
kind: "Native";
|
|
48
|
+
amount: string;
|
|
49
|
+
} | {
|
|
50
|
+
kind: "Erc20";
|
|
51
|
+
contract: string;
|
|
52
|
+
amount: string;
|
|
53
|
+
}) & {
|
|
54
|
+
metadata: {
|
|
55
|
+
network: "Algorand" | "AlgorandTestnet" | "Aptos" | "AptosTestnet" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Adi" | "AdiTestnet" | "BabylonGenesis" | "BabylonTestnet5" | "Base" | "BaseGoerli" | "BaseSepolia" | "Berachain" | "BerachainBArtio" | "BerachainBepolia" | "Bitcoin" | "BitcoinSignet" | "BitcoinTestnet3" | "BitcoinCash" | "BitcoinCashTestnet" | "Bob" | "BobSepolia" | "Bsc" | "BscTestnet" | "Canton" | "CantonDevnet" | "CantonTestnet" | "Cardano" | "CardanoPreprod" | "Celo" | "CeloAlfajores" | "Codex" | "CodexSepolia" | "CosmosHub4" | "CosmosIcsTestnet" | "Dogecoin" | "DogecoinTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "EthereumHoodi" | "FantomOpera" | "FantomTestnet" | "FlareC" | "FlareCCoston2" | "Hedera" | "HederaTestnet" | "Ink" | "InkSepolia" | "InternetComputer" | "Ion" | "IonTestnet" | "Iota" | "IotaTestnet" | "IotaZodianet" | "KadenaTestnet4" | "KadenaTestnet4:1" | "KadenaTestnet4:2" | "KadenaTestnet4:3" | "KadenaTestnet4:4" | "KadenaTestnet4:5" | "KadenaTestnet4:6" | "KadenaTestnet4:7" | "KadenaTestnet4:8" | "KadenaTestnet4:9" | "KadenaTestnet4:10" | "KadenaTestnet4:11" | "KadenaTestnet4:12" | "KadenaTestnet4:13" | "KadenaTestnet4:14" | "KadenaTestnet4:15" | "KadenaTestnet4:16" | "KadenaTestnet4:17" | "KadenaTestnet4:18" | "KadenaTestnet4:19" | "Kadena" | "Kadena:1" | "Kadena:2" | "Kadena:3" | "Kadena:4" | "Kadena:5" | "Kadena:6" | "Kadena:7" | "Kadena:8" | "Kadena:9" | "Kadena:10" | "Kadena:11" | "Kadena:12" | "Kadena:13" | "Kadena:14" | "Kadena:15" | "Kadena:16" | "Kadena:17" | "Kadena:18" | "Kadena:19" | "Kaspa" | "KaspaTestnet11" | "Kusama" | "Litecoin" | "LitecoinTestnet" | "Near" | "NearTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Origyn" | "Plume" | "PlumeSepolia" | "Polkadot" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Polymesh" | "PolymeshTestnet" | "Race" | "RaceSepolia" | "SeiAtlantic2" | "SeiPacific1" | "Solana" | "SolanaDevnet" | "Sonic" | "SonicTestnet" | "Stellar" | "StellarTestnet" | "Sui" | "SuiTestnet" | "Tsc" | "TscTestnet1" | "Tezos" | "TezosGhostnet" | "Ton" | "TonTestnet" | "Tron" | "TronNile" | "Westend" | "XrpLedger" | "XrpLedgerTestnet";
|
|
56
|
+
name?: string | undefined;
|
|
57
|
+
symbol?: string | undefined;
|
|
58
|
+
decimals: number;
|
|
59
|
+
tid?: string | undefined;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
dateCreated: string;
|
|
63
|
+
} & {
|
|
64
|
+
actions: {
|
|
65
|
+
/** Unique identifier for the yield action. */
|
|
66
|
+
id: string;
|
|
67
|
+
/** Unique identifier for the yield investment. */
|
|
68
|
+
yieldId: string;
|
|
69
|
+
/** An optional external identifier provided by the client to ensure idempotency and prevent duplicate operations. */
|
|
70
|
+
externalId?: string | undefined;
|
|
71
|
+
/** The type of action being performed on the yield investment: Deposit to add funds or Withdraw to remove funds. */
|
|
72
|
+
kind: "Deposit" | "Withdraw";
|
|
73
|
+
/** Status of the yield action. Once initiated, the status will be InProgress, after processing it will be Completed or Failed. */
|
|
74
|
+
status: "PendingPolicyApproval" | "InProgress" | "Completed" | "Failed" | "Rejected";
|
|
75
|
+
requester: {
|
|
76
|
+
/** User (could be a service account) who requested the resource. */
|
|
77
|
+
userId: string;
|
|
78
|
+
/** Service Account token or Personal Access token used when requesting the resource. */
|
|
79
|
+
tokenId?: string | undefined;
|
|
80
|
+
};
|
|
81
|
+
/** The full request used for initiating this yield action. */
|
|
82
|
+
requestBody: {
|
|
83
|
+
/** The type of action being performed on the yield investment: Deposit to add funds or Withdraw to remove funds. */
|
|
84
|
+
kind: "Deposit" | "Withdraw";
|
|
85
|
+
/** An optional external identifier provided by the client to ensure idempotency and prevent duplicate operations. */
|
|
86
|
+
externalId?: string | undefined;
|
|
87
|
+
sourceAsset: {
|
|
88
|
+
kind: "Erc20";
|
|
89
|
+
contract: string;
|
|
90
|
+
amount: string;
|
|
91
|
+
};
|
|
92
|
+
targetAsset: {
|
|
93
|
+
kind: "Erc20";
|
|
94
|
+
contract: string;
|
|
95
|
+
amount: string;
|
|
96
|
+
};
|
|
97
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you're willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. */
|
|
98
|
+
slippageBps: number;
|
|
99
|
+
} | {
|
|
100
|
+
/** Wallet id. */
|
|
101
|
+
walletId: string;
|
|
102
|
+
/** Ofns protocol */
|
|
103
|
+
protocol: "0fns";
|
|
104
|
+
/** An optional external identifier provided by the client to ensure idempotency and prevent duplicate operations. */
|
|
105
|
+
externalId?: string | undefined;
|
|
106
|
+
sourceAsset: {
|
|
107
|
+
kind: "Erc20";
|
|
108
|
+
contract: string;
|
|
109
|
+
amount: string;
|
|
110
|
+
};
|
|
111
|
+
targetAsset: {
|
|
112
|
+
kind: "Erc20";
|
|
113
|
+
contract: string;
|
|
114
|
+
amount: string;
|
|
115
|
+
};
|
|
116
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you're willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. */
|
|
117
|
+
slippageBps: number;
|
|
118
|
+
};
|
|
119
|
+
dateCreated: string;
|
|
120
|
+
}[];
|
|
121
|
+
};
|
|
122
|
+
export type CreateYieldRequest = {
|
|
123
|
+
body: CreateYieldBody;
|
|
124
|
+
};
|
|
125
|
+
export type CreateYieldActionBody = {
|
|
126
|
+
/** The type of action being performed on the yield investment: Deposit to add funds or Withdraw to remove funds. */
|
|
127
|
+
kind: "Deposit" | "Withdraw";
|
|
128
|
+
/** An optional external identifier provided by the client to ensure idempotency and prevent duplicate operations. */
|
|
129
|
+
externalId?: string | undefined;
|
|
130
|
+
sourceAsset: {
|
|
131
|
+
kind: "Erc20";
|
|
132
|
+
contract: string;
|
|
133
|
+
amount: string;
|
|
134
|
+
};
|
|
135
|
+
targetAsset: {
|
|
136
|
+
kind: "Erc20";
|
|
137
|
+
contract: string;
|
|
138
|
+
amount: string;
|
|
139
|
+
};
|
|
140
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you're willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. */
|
|
141
|
+
slippageBps: number;
|
|
142
|
+
};
|
|
143
|
+
export type CreateYieldActionParams = {
|
|
144
|
+
/** Unique identifier for the yield investment. */
|
|
145
|
+
yieldId: string;
|
|
146
|
+
};
|
|
147
|
+
export type CreateYieldActionResponse = {
|
|
148
|
+
/** Unique identifier for the yield investment. */
|
|
149
|
+
id: string;
|
|
150
|
+
/** Wallet id. */
|
|
151
|
+
walletId: string;
|
|
152
|
+
/** The DeFi protocol used for yield generation. Currently supports OFNS protocol */
|
|
153
|
+
protocol: "0fns";
|
|
154
|
+
/** The total amount currently invested in this yield. */
|
|
155
|
+
amount: ({
|
|
156
|
+
kind: "Native";
|
|
157
|
+
amount: string;
|
|
158
|
+
} | {
|
|
159
|
+
kind: "Erc20";
|
|
160
|
+
contract: string;
|
|
161
|
+
amount: string;
|
|
162
|
+
}) & {
|
|
163
|
+
metadata: {
|
|
164
|
+
network: "Algorand" | "AlgorandTestnet" | "Aptos" | "AptosTestnet" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Adi" | "AdiTestnet" | "BabylonGenesis" | "BabylonTestnet5" | "Base" | "BaseGoerli" | "BaseSepolia" | "Berachain" | "BerachainBArtio" | "BerachainBepolia" | "Bitcoin" | "BitcoinSignet" | "BitcoinTestnet3" | "BitcoinCash" | "BitcoinCashTestnet" | "Bob" | "BobSepolia" | "Bsc" | "BscTestnet" | "Canton" | "CantonDevnet" | "CantonTestnet" | "Cardano" | "CardanoPreprod" | "Celo" | "CeloAlfajores" | "Codex" | "CodexSepolia" | "CosmosHub4" | "CosmosIcsTestnet" | "Dogecoin" | "DogecoinTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "EthereumHoodi" | "FantomOpera" | "FantomTestnet" | "FlareC" | "FlareCCoston2" | "Hedera" | "HederaTestnet" | "Ink" | "InkSepolia" | "InternetComputer" | "Ion" | "IonTestnet" | "Iota" | "IotaTestnet" | "IotaZodianet" | "KadenaTestnet4" | "KadenaTestnet4:1" | "KadenaTestnet4:2" | "KadenaTestnet4:3" | "KadenaTestnet4:4" | "KadenaTestnet4:5" | "KadenaTestnet4:6" | "KadenaTestnet4:7" | "KadenaTestnet4:8" | "KadenaTestnet4:9" | "KadenaTestnet4:10" | "KadenaTestnet4:11" | "KadenaTestnet4:12" | "KadenaTestnet4:13" | "KadenaTestnet4:14" | "KadenaTestnet4:15" | "KadenaTestnet4:16" | "KadenaTestnet4:17" | "KadenaTestnet4:18" | "KadenaTestnet4:19" | "Kadena" | "Kadena:1" | "Kadena:2" | "Kadena:3" | "Kadena:4" | "Kadena:5" | "Kadena:6" | "Kadena:7" | "Kadena:8" | "Kadena:9" | "Kadena:10" | "Kadena:11" | "Kadena:12" | "Kadena:13" | "Kadena:14" | "Kadena:15" | "Kadena:16" | "Kadena:17" | "Kadena:18" | "Kadena:19" | "Kaspa" | "KaspaTestnet11" | "Kusama" | "Litecoin" | "LitecoinTestnet" | "Near" | "NearTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Origyn" | "Plume" | "PlumeSepolia" | "Polkadot" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Polymesh" | "PolymeshTestnet" | "Race" | "RaceSepolia" | "SeiAtlantic2" | "SeiPacific1" | "Solana" | "SolanaDevnet" | "Sonic" | "SonicTestnet" | "Stellar" | "StellarTestnet" | "Sui" | "SuiTestnet" | "Tsc" | "TscTestnet1" | "Tezos" | "TezosGhostnet" | "Ton" | "TonTestnet" | "Tron" | "TronNile" | "Westend" | "XrpLedger" | "XrpLedgerTestnet";
|
|
165
|
+
name?: string | undefined;
|
|
166
|
+
symbol?: string | undefined;
|
|
167
|
+
decimals: number;
|
|
168
|
+
tid?: string | undefined;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
/** The total interest earned so far in this yield. */
|
|
172
|
+
rewards: ({
|
|
173
|
+
kind: "Native";
|
|
174
|
+
amount: string;
|
|
175
|
+
} | {
|
|
176
|
+
kind: "Erc20";
|
|
177
|
+
contract: string;
|
|
178
|
+
amount: string;
|
|
179
|
+
}) & {
|
|
180
|
+
metadata: {
|
|
181
|
+
network: "Algorand" | "AlgorandTestnet" | "Aptos" | "AptosTestnet" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Adi" | "AdiTestnet" | "BabylonGenesis" | "BabylonTestnet5" | "Base" | "BaseGoerli" | "BaseSepolia" | "Berachain" | "BerachainBArtio" | "BerachainBepolia" | "Bitcoin" | "BitcoinSignet" | "BitcoinTestnet3" | "BitcoinCash" | "BitcoinCashTestnet" | "Bob" | "BobSepolia" | "Bsc" | "BscTestnet" | "Canton" | "CantonDevnet" | "CantonTestnet" | "Cardano" | "CardanoPreprod" | "Celo" | "CeloAlfajores" | "Codex" | "CodexSepolia" | "CosmosHub4" | "CosmosIcsTestnet" | "Dogecoin" | "DogecoinTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "EthereumHoodi" | "FantomOpera" | "FantomTestnet" | "FlareC" | "FlareCCoston2" | "Hedera" | "HederaTestnet" | "Ink" | "InkSepolia" | "InternetComputer" | "Ion" | "IonTestnet" | "Iota" | "IotaTestnet" | "IotaZodianet" | "KadenaTestnet4" | "KadenaTestnet4:1" | "KadenaTestnet4:2" | "KadenaTestnet4:3" | "KadenaTestnet4:4" | "KadenaTestnet4:5" | "KadenaTestnet4:6" | "KadenaTestnet4:7" | "KadenaTestnet4:8" | "KadenaTestnet4:9" | "KadenaTestnet4:10" | "KadenaTestnet4:11" | "KadenaTestnet4:12" | "KadenaTestnet4:13" | "KadenaTestnet4:14" | "KadenaTestnet4:15" | "KadenaTestnet4:16" | "KadenaTestnet4:17" | "KadenaTestnet4:18" | "KadenaTestnet4:19" | "Kadena" | "Kadena:1" | "Kadena:2" | "Kadena:3" | "Kadena:4" | "Kadena:5" | "Kadena:6" | "Kadena:7" | "Kadena:8" | "Kadena:9" | "Kadena:10" | "Kadena:11" | "Kadena:12" | "Kadena:13" | "Kadena:14" | "Kadena:15" | "Kadena:16" | "Kadena:17" | "Kadena:18" | "Kadena:19" | "Kaspa" | "KaspaTestnet11" | "Kusama" | "Litecoin" | "LitecoinTestnet" | "Near" | "NearTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Origyn" | "Plume" | "PlumeSepolia" | "Polkadot" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Polymesh" | "PolymeshTestnet" | "Race" | "RaceSepolia" | "SeiAtlantic2" | "SeiPacific1" | "Solana" | "SolanaDevnet" | "Sonic" | "SonicTestnet" | "Stellar" | "StellarTestnet" | "Sui" | "SuiTestnet" | "Tsc" | "TscTestnet1" | "Tezos" | "TezosGhostnet" | "Ton" | "TonTestnet" | "Tron" | "TronNile" | "Westend" | "XrpLedger" | "XrpLedgerTestnet";
|
|
182
|
+
name?: string | undefined;
|
|
183
|
+
symbol?: string | undefined;
|
|
184
|
+
decimals: number;
|
|
185
|
+
tid?: string | undefined;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
dateCreated: string;
|
|
189
|
+
} & {
|
|
190
|
+
actions: {
|
|
191
|
+
/** Unique identifier for the yield action. */
|
|
192
|
+
id: string;
|
|
193
|
+
/** Unique identifier for the yield investment. */
|
|
194
|
+
yieldId: string;
|
|
195
|
+
/** An optional external identifier provided by the client to ensure idempotency and prevent duplicate operations. */
|
|
196
|
+
externalId?: string | undefined;
|
|
197
|
+
/** The type of action being performed on the yield investment: Deposit to add funds or Withdraw to remove funds. */
|
|
198
|
+
kind: "Deposit" | "Withdraw";
|
|
199
|
+
/** Status of the yield action. Once initiated, the status will be InProgress, after processing it will be Completed or Failed. */
|
|
200
|
+
status: "PendingPolicyApproval" | "InProgress" | "Completed" | "Failed" | "Rejected";
|
|
201
|
+
requester: {
|
|
202
|
+
/** User (could be a service account) who requested the resource. */
|
|
203
|
+
userId: string;
|
|
204
|
+
/** Service Account token or Personal Access token used when requesting the resource. */
|
|
205
|
+
tokenId?: string | undefined;
|
|
206
|
+
};
|
|
207
|
+
/** The full request used for initiating this yield action. */
|
|
208
|
+
requestBody: {
|
|
209
|
+
/** The type of action being performed on the yield investment: Deposit to add funds or Withdraw to remove funds. */
|
|
210
|
+
kind: "Deposit" | "Withdraw";
|
|
211
|
+
/** An optional external identifier provided by the client to ensure idempotency and prevent duplicate operations. */
|
|
212
|
+
externalId?: string | undefined;
|
|
213
|
+
sourceAsset: {
|
|
214
|
+
kind: "Erc20";
|
|
215
|
+
contract: string;
|
|
216
|
+
amount: string;
|
|
217
|
+
};
|
|
218
|
+
targetAsset: {
|
|
219
|
+
kind: "Erc20";
|
|
220
|
+
contract: string;
|
|
221
|
+
amount: string;
|
|
222
|
+
};
|
|
223
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you're willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. */
|
|
224
|
+
slippageBps: number;
|
|
225
|
+
} | {
|
|
226
|
+
/** Wallet id. */
|
|
227
|
+
walletId: string;
|
|
228
|
+
/** Ofns protocol */
|
|
229
|
+
protocol: "0fns";
|
|
230
|
+
/** An optional external identifier provided by the client to ensure idempotency and prevent duplicate operations. */
|
|
231
|
+
externalId?: string | undefined;
|
|
232
|
+
sourceAsset: {
|
|
233
|
+
kind: "Erc20";
|
|
234
|
+
contract: string;
|
|
235
|
+
amount: string;
|
|
236
|
+
};
|
|
237
|
+
targetAsset: {
|
|
238
|
+
kind: "Erc20";
|
|
239
|
+
contract: string;
|
|
240
|
+
amount: string;
|
|
241
|
+
};
|
|
242
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you're willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. */
|
|
243
|
+
slippageBps: number;
|
|
244
|
+
};
|
|
245
|
+
dateCreated: string;
|
|
246
|
+
}[];
|
|
247
|
+
};
|
|
248
|
+
export type CreateYieldActionRequest = CreateYieldActionParams & {
|
|
249
|
+
body: CreateYieldActionBody;
|
|
250
|
+
};
|
|
251
|
+
export type GetYieldParams = {
|
|
252
|
+
/** Unique identifier for the yield investment. */
|
|
253
|
+
yieldId: string;
|
|
254
|
+
};
|
|
255
|
+
export type GetYieldResponse = {
|
|
256
|
+
/** Unique identifier for the yield investment. */
|
|
257
|
+
id: string;
|
|
258
|
+
/** Wallet id. */
|
|
259
|
+
walletId: string;
|
|
260
|
+
/** The DeFi protocol used for yield generation. Currently supports OFNS protocol */
|
|
261
|
+
protocol: "0fns";
|
|
262
|
+
/** The total amount currently invested in this yield. */
|
|
263
|
+
amount: ({
|
|
264
|
+
kind: "Native";
|
|
265
|
+
amount: string;
|
|
266
|
+
} | {
|
|
267
|
+
kind: "Erc20";
|
|
268
|
+
contract: string;
|
|
269
|
+
amount: string;
|
|
270
|
+
}) & {
|
|
271
|
+
metadata: {
|
|
272
|
+
network: "Algorand" | "AlgorandTestnet" | "Aptos" | "AptosTestnet" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Adi" | "AdiTestnet" | "BabylonGenesis" | "BabylonTestnet5" | "Base" | "BaseGoerli" | "BaseSepolia" | "Berachain" | "BerachainBArtio" | "BerachainBepolia" | "Bitcoin" | "BitcoinSignet" | "BitcoinTestnet3" | "BitcoinCash" | "BitcoinCashTestnet" | "Bob" | "BobSepolia" | "Bsc" | "BscTestnet" | "Canton" | "CantonDevnet" | "CantonTestnet" | "Cardano" | "CardanoPreprod" | "Celo" | "CeloAlfajores" | "Codex" | "CodexSepolia" | "CosmosHub4" | "CosmosIcsTestnet" | "Dogecoin" | "DogecoinTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "EthereumHoodi" | "FantomOpera" | "FantomTestnet" | "FlareC" | "FlareCCoston2" | "Hedera" | "HederaTestnet" | "Ink" | "InkSepolia" | "InternetComputer" | "Ion" | "IonTestnet" | "Iota" | "IotaTestnet" | "IotaZodianet" | "KadenaTestnet4" | "KadenaTestnet4:1" | "KadenaTestnet4:2" | "KadenaTestnet4:3" | "KadenaTestnet4:4" | "KadenaTestnet4:5" | "KadenaTestnet4:6" | "KadenaTestnet4:7" | "KadenaTestnet4:8" | "KadenaTestnet4:9" | "KadenaTestnet4:10" | "KadenaTestnet4:11" | "KadenaTestnet4:12" | "KadenaTestnet4:13" | "KadenaTestnet4:14" | "KadenaTestnet4:15" | "KadenaTestnet4:16" | "KadenaTestnet4:17" | "KadenaTestnet4:18" | "KadenaTestnet4:19" | "Kadena" | "Kadena:1" | "Kadena:2" | "Kadena:3" | "Kadena:4" | "Kadena:5" | "Kadena:6" | "Kadena:7" | "Kadena:8" | "Kadena:9" | "Kadena:10" | "Kadena:11" | "Kadena:12" | "Kadena:13" | "Kadena:14" | "Kadena:15" | "Kadena:16" | "Kadena:17" | "Kadena:18" | "Kadena:19" | "Kaspa" | "KaspaTestnet11" | "Kusama" | "Litecoin" | "LitecoinTestnet" | "Near" | "NearTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Origyn" | "Plume" | "PlumeSepolia" | "Polkadot" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Polymesh" | "PolymeshTestnet" | "Race" | "RaceSepolia" | "SeiAtlantic2" | "SeiPacific1" | "Solana" | "SolanaDevnet" | "Sonic" | "SonicTestnet" | "Stellar" | "StellarTestnet" | "Sui" | "SuiTestnet" | "Tsc" | "TscTestnet1" | "Tezos" | "TezosGhostnet" | "Ton" | "TonTestnet" | "Tron" | "TronNile" | "Westend" | "XrpLedger" | "XrpLedgerTestnet";
|
|
273
|
+
name?: string | undefined;
|
|
274
|
+
symbol?: string | undefined;
|
|
275
|
+
decimals: number;
|
|
276
|
+
tid?: string | undefined;
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
/** The total interest earned so far in this yield. */
|
|
280
|
+
rewards: ({
|
|
281
|
+
kind: "Native";
|
|
282
|
+
amount: string;
|
|
283
|
+
} | {
|
|
284
|
+
kind: "Erc20";
|
|
285
|
+
contract: string;
|
|
286
|
+
amount: string;
|
|
287
|
+
}) & {
|
|
288
|
+
metadata: {
|
|
289
|
+
network: "Algorand" | "AlgorandTestnet" | "Aptos" | "AptosTestnet" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Adi" | "AdiTestnet" | "BabylonGenesis" | "BabylonTestnet5" | "Base" | "BaseGoerli" | "BaseSepolia" | "Berachain" | "BerachainBArtio" | "BerachainBepolia" | "Bitcoin" | "BitcoinSignet" | "BitcoinTestnet3" | "BitcoinCash" | "BitcoinCashTestnet" | "Bob" | "BobSepolia" | "Bsc" | "BscTestnet" | "Canton" | "CantonDevnet" | "CantonTestnet" | "Cardano" | "CardanoPreprod" | "Celo" | "CeloAlfajores" | "Codex" | "CodexSepolia" | "CosmosHub4" | "CosmosIcsTestnet" | "Dogecoin" | "DogecoinTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "EthereumHoodi" | "FantomOpera" | "FantomTestnet" | "FlareC" | "FlareCCoston2" | "Hedera" | "HederaTestnet" | "Ink" | "InkSepolia" | "InternetComputer" | "Ion" | "IonTestnet" | "Iota" | "IotaTestnet" | "IotaZodianet" | "KadenaTestnet4" | "KadenaTestnet4:1" | "KadenaTestnet4:2" | "KadenaTestnet4:3" | "KadenaTestnet4:4" | "KadenaTestnet4:5" | "KadenaTestnet4:6" | "KadenaTestnet4:7" | "KadenaTestnet4:8" | "KadenaTestnet4:9" | "KadenaTestnet4:10" | "KadenaTestnet4:11" | "KadenaTestnet4:12" | "KadenaTestnet4:13" | "KadenaTestnet4:14" | "KadenaTestnet4:15" | "KadenaTestnet4:16" | "KadenaTestnet4:17" | "KadenaTestnet4:18" | "KadenaTestnet4:19" | "Kadena" | "Kadena:1" | "Kadena:2" | "Kadena:3" | "Kadena:4" | "Kadena:5" | "Kadena:6" | "Kadena:7" | "Kadena:8" | "Kadena:9" | "Kadena:10" | "Kadena:11" | "Kadena:12" | "Kadena:13" | "Kadena:14" | "Kadena:15" | "Kadena:16" | "Kadena:17" | "Kadena:18" | "Kadena:19" | "Kaspa" | "KaspaTestnet11" | "Kusama" | "Litecoin" | "LitecoinTestnet" | "Near" | "NearTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Origyn" | "Plume" | "PlumeSepolia" | "Polkadot" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Polymesh" | "PolymeshTestnet" | "Race" | "RaceSepolia" | "SeiAtlantic2" | "SeiPacific1" | "Solana" | "SolanaDevnet" | "Sonic" | "SonicTestnet" | "Stellar" | "StellarTestnet" | "Sui" | "SuiTestnet" | "Tsc" | "TscTestnet1" | "Tezos" | "TezosGhostnet" | "Ton" | "TonTestnet" | "Tron" | "TronNile" | "Westend" | "XrpLedger" | "XrpLedgerTestnet";
|
|
290
|
+
name?: string | undefined;
|
|
291
|
+
symbol?: string | undefined;
|
|
292
|
+
decimals: number;
|
|
293
|
+
tid?: string | undefined;
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
dateCreated: string;
|
|
297
|
+
} & {
|
|
298
|
+
actions: {
|
|
299
|
+
/** Unique identifier for the yield action. */
|
|
300
|
+
id: string;
|
|
301
|
+
/** Unique identifier for the yield investment. */
|
|
302
|
+
yieldId: string;
|
|
303
|
+
/** An optional external identifier provided by the client to ensure idempotency and prevent duplicate operations. */
|
|
304
|
+
externalId?: string | undefined;
|
|
305
|
+
/** The type of action being performed on the yield investment: Deposit to add funds or Withdraw to remove funds. */
|
|
306
|
+
kind: "Deposit" | "Withdraw";
|
|
307
|
+
/** Status of the yield action. Once initiated, the status will be InProgress, after processing it will be Completed or Failed. */
|
|
308
|
+
status: "PendingPolicyApproval" | "InProgress" | "Completed" | "Failed" | "Rejected";
|
|
309
|
+
requester: {
|
|
310
|
+
/** User (could be a service account) who requested the resource. */
|
|
311
|
+
userId: string;
|
|
312
|
+
/** Service Account token or Personal Access token used when requesting the resource. */
|
|
313
|
+
tokenId?: string | undefined;
|
|
314
|
+
};
|
|
315
|
+
/** The full request used for initiating this yield action. */
|
|
316
|
+
requestBody: {
|
|
317
|
+
/** The type of action being performed on the yield investment: Deposit to add funds or Withdraw to remove funds. */
|
|
318
|
+
kind: "Deposit" | "Withdraw";
|
|
319
|
+
/** An optional external identifier provided by the client to ensure idempotency and prevent duplicate operations. */
|
|
320
|
+
externalId?: string | undefined;
|
|
321
|
+
sourceAsset: {
|
|
322
|
+
kind: "Erc20";
|
|
323
|
+
contract: string;
|
|
324
|
+
amount: string;
|
|
325
|
+
};
|
|
326
|
+
targetAsset: {
|
|
327
|
+
kind: "Erc20";
|
|
328
|
+
contract: string;
|
|
329
|
+
amount: string;
|
|
330
|
+
};
|
|
331
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you're willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. */
|
|
332
|
+
slippageBps: number;
|
|
333
|
+
} | {
|
|
334
|
+
/** Wallet id. */
|
|
335
|
+
walletId: string;
|
|
336
|
+
/** Ofns protocol */
|
|
337
|
+
protocol: "0fns";
|
|
338
|
+
/** An optional external identifier provided by the client to ensure idempotency and prevent duplicate operations. */
|
|
339
|
+
externalId?: string | undefined;
|
|
340
|
+
sourceAsset: {
|
|
341
|
+
kind: "Erc20";
|
|
342
|
+
contract: string;
|
|
343
|
+
amount: string;
|
|
344
|
+
};
|
|
345
|
+
targetAsset: {
|
|
346
|
+
kind: "Erc20";
|
|
347
|
+
contract: string;
|
|
348
|
+
amount: string;
|
|
349
|
+
};
|
|
350
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you're willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. */
|
|
351
|
+
slippageBps: number;
|
|
352
|
+
};
|
|
353
|
+
dateCreated: string;
|
|
354
|
+
}[];
|
|
355
|
+
};
|
|
356
|
+
export type GetYieldRequest = GetYieldParams;
|
|
357
|
+
export type ListYieldActionsParams = {
|
|
358
|
+
/** Unique identifier for the yield investment. */
|
|
359
|
+
yieldId: string;
|
|
360
|
+
};
|
|
361
|
+
export type ListYieldActionsQuery = {
|
|
362
|
+
/** Maximum number of items to return. */
|
|
363
|
+
limit?: number | undefined;
|
|
364
|
+
/** Opaque token used to retrieve the next page. Returned as `nextPageToken` from the previous request. */
|
|
365
|
+
paginationToken?: string | undefined;
|
|
366
|
+
};
|
|
367
|
+
export type ListYieldActionsResponse = {
|
|
368
|
+
/** Current page items. */
|
|
369
|
+
items: {
|
|
370
|
+
/** Unique identifier for the yield action. */
|
|
371
|
+
id: string;
|
|
372
|
+
/** Unique identifier for the yield investment. */
|
|
373
|
+
yieldId: string;
|
|
374
|
+
/** An optional external identifier provided by the client to ensure idempotency and prevent duplicate operations. */
|
|
375
|
+
externalId?: string | undefined;
|
|
376
|
+
/** The type of action being performed on the yield investment: Deposit to add funds or Withdraw to remove funds. */
|
|
377
|
+
kind: "Deposit" | "Withdraw";
|
|
378
|
+
/** Status of the yield action. Once initiated, the status will be InProgress, after processing it will be Completed or Failed. */
|
|
379
|
+
status: "PendingPolicyApproval" | "InProgress" | "Completed" | "Failed" | "Rejected";
|
|
380
|
+
requester: {
|
|
381
|
+
/** User (could be a service account) who requested the resource. */
|
|
382
|
+
userId: string;
|
|
383
|
+
/** Service Account token or Personal Access token used when requesting the resource. */
|
|
384
|
+
tokenId?: string | undefined;
|
|
385
|
+
};
|
|
386
|
+
/** The full request used for initiating this yield action. */
|
|
387
|
+
requestBody: {
|
|
388
|
+
/** The type of action being performed on the yield investment: Deposit to add funds or Withdraw to remove funds. */
|
|
389
|
+
kind: "Deposit" | "Withdraw";
|
|
390
|
+
/** An optional external identifier provided by the client to ensure idempotency and prevent duplicate operations. */
|
|
391
|
+
externalId?: string | undefined;
|
|
392
|
+
sourceAsset: {
|
|
393
|
+
kind: "Erc20";
|
|
394
|
+
contract: string;
|
|
395
|
+
amount: string;
|
|
396
|
+
};
|
|
397
|
+
targetAsset: {
|
|
398
|
+
kind: "Erc20";
|
|
399
|
+
contract: string;
|
|
400
|
+
amount: string;
|
|
401
|
+
};
|
|
402
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you're willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. */
|
|
403
|
+
slippageBps: number;
|
|
404
|
+
} | {
|
|
405
|
+
/** Wallet id. */
|
|
406
|
+
walletId: string;
|
|
407
|
+
/** Ofns protocol */
|
|
408
|
+
protocol: "0fns";
|
|
409
|
+
/** An optional external identifier provided by the client to ensure idempotency and prevent duplicate operations. */
|
|
410
|
+
externalId?: string | undefined;
|
|
411
|
+
sourceAsset: {
|
|
412
|
+
kind: "Erc20";
|
|
413
|
+
contract: string;
|
|
414
|
+
amount: string;
|
|
415
|
+
};
|
|
416
|
+
targetAsset: {
|
|
417
|
+
kind: "Erc20";
|
|
418
|
+
contract: string;
|
|
419
|
+
amount: string;
|
|
420
|
+
};
|
|
421
|
+
/** The slippage tolerance for this trade in [basis point](https://en.wikipedia.org/wiki/Basis_point) (BPS). Slippage tolerance defines the maximum price difference you're willing to accept during a trade from the estimated quote, ensuring you still receive at least a minimum number of tokens if the price shifts. One basis point equals one-hundredth of a percentage point, or 0.01%. */
|
|
422
|
+
slippageBps: number;
|
|
423
|
+
};
|
|
424
|
+
dateCreated: string;
|
|
425
|
+
}[];
|
|
426
|
+
/** token to use as `paginationToken` to request the next page. */
|
|
427
|
+
nextPageToken?: string | undefined;
|
|
428
|
+
};
|
|
429
|
+
export type ListYieldActionsRequest = ListYieldActionsParams & {
|
|
430
|
+
query?: ListYieldActionsQuery;
|
|
431
|
+
};
|
|
432
|
+
export type ListYieldsQuery = {
|
|
433
|
+
/** Maximum number of items to return. */
|
|
434
|
+
limit?: number | undefined;
|
|
435
|
+
/** Opaque token used to retrieve the next page. Returned as `nextPageToken` from the previous request. */
|
|
436
|
+
paginationToken?: string | undefined;
|
|
437
|
+
};
|
|
438
|
+
export type ListYieldsResponse = {
|
|
439
|
+
/** Current page items. */
|
|
440
|
+
items: {
|
|
441
|
+
/** Unique identifier for the yield investment. */
|
|
442
|
+
id: string;
|
|
443
|
+
/** Wallet id. */
|
|
444
|
+
walletId: string;
|
|
445
|
+
/** The DeFi protocol used for yield generation. Currently supports OFNS protocol */
|
|
446
|
+
protocol: "0fns";
|
|
447
|
+
/** The total amount currently invested in this yield. */
|
|
448
|
+
amount: ({
|
|
449
|
+
kind: "Native";
|
|
450
|
+
amount: string;
|
|
451
|
+
} | {
|
|
452
|
+
kind: "Erc20";
|
|
453
|
+
contract: string;
|
|
454
|
+
amount: string;
|
|
455
|
+
}) & {
|
|
456
|
+
metadata: {
|
|
457
|
+
network: "Algorand" | "AlgorandTestnet" | "Aptos" | "AptosTestnet" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Adi" | "AdiTestnet" | "BabylonGenesis" | "BabylonTestnet5" | "Base" | "BaseGoerli" | "BaseSepolia" | "Berachain" | "BerachainBArtio" | "BerachainBepolia" | "Bitcoin" | "BitcoinSignet" | "BitcoinTestnet3" | "BitcoinCash" | "BitcoinCashTestnet" | "Bob" | "BobSepolia" | "Bsc" | "BscTestnet" | "Canton" | "CantonDevnet" | "CantonTestnet" | "Cardano" | "CardanoPreprod" | "Celo" | "CeloAlfajores" | "Codex" | "CodexSepolia" | "CosmosHub4" | "CosmosIcsTestnet" | "Dogecoin" | "DogecoinTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "EthereumHoodi" | "FantomOpera" | "FantomTestnet" | "FlareC" | "FlareCCoston2" | "Hedera" | "HederaTestnet" | "Ink" | "InkSepolia" | "InternetComputer" | "Ion" | "IonTestnet" | "Iota" | "IotaTestnet" | "IotaZodianet" | "KadenaTestnet4" | "KadenaTestnet4:1" | "KadenaTestnet4:2" | "KadenaTestnet4:3" | "KadenaTestnet4:4" | "KadenaTestnet4:5" | "KadenaTestnet4:6" | "KadenaTestnet4:7" | "KadenaTestnet4:8" | "KadenaTestnet4:9" | "KadenaTestnet4:10" | "KadenaTestnet4:11" | "KadenaTestnet4:12" | "KadenaTestnet4:13" | "KadenaTestnet4:14" | "KadenaTestnet4:15" | "KadenaTestnet4:16" | "KadenaTestnet4:17" | "KadenaTestnet4:18" | "KadenaTestnet4:19" | "Kadena" | "Kadena:1" | "Kadena:2" | "Kadena:3" | "Kadena:4" | "Kadena:5" | "Kadena:6" | "Kadena:7" | "Kadena:8" | "Kadena:9" | "Kadena:10" | "Kadena:11" | "Kadena:12" | "Kadena:13" | "Kadena:14" | "Kadena:15" | "Kadena:16" | "Kadena:17" | "Kadena:18" | "Kadena:19" | "Kaspa" | "KaspaTestnet11" | "Kusama" | "Litecoin" | "LitecoinTestnet" | "Near" | "NearTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Origyn" | "Plume" | "PlumeSepolia" | "Polkadot" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Polymesh" | "PolymeshTestnet" | "Race" | "RaceSepolia" | "SeiAtlantic2" | "SeiPacific1" | "Solana" | "SolanaDevnet" | "Sonic" | "SonicTestnet" | "Stellar" | "StellarTestnet" | "Sui" | "SuiTestnet" | "Tsc" | "TscTestnet1" | "Tezos" | "TezosGhostnet" | "Ton" | "TonTestnet" | "Tron" | "TronNile" | "Westend" | "XrpLedger" | "XrpLedgerTestnet";
|
|
458
|
+
name?: string | undefined;
|
|
459
|
+
symbol?: string | undefined;
|
|
460
|
+
decimals: number;
|
|
461
|
+
tid?: string | undefined;
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
/** The total interest earned so far in this yield. */
|
|
465
|
+
rewards: ({
|
|
466
|
+
kind: "Native";
|
|
467
|
+
amount: string;
|
|
468
|
+
} | {
|
|
469
|
+
kind: "Erc20";
|
|
470
|
+
contract: string;
|
|
471
|
+
amount: string;
|
|
472
|
+
}) & {
|
|
473
|
+
metadata: {
|
|
474
|
+
network: "Algorand" | "AlgorandTestnet" | "Aptos" | "AptosTestnet" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Adi" | "AdiTestnet" | "BabylonGenesis" | "BabylonTestnet5" | "Base" | "BaseGoerli" | "BaseSepolia" | "Berachain" | "BerachainBArtio" | "BerachainBepolia" | "Bitcoin" | "BitcoinSignet" | "BitcoinTestnet3" | "BitcoinCash" | "BitcoinCashTestnet" | "Bob" | "BobSepolia" | "Bsc" | "BscTestnet" | "Canton" | "CantonDevnet" | "CantonTestnet" | "Cardano" | "CardanoPreprod" | "Celo" | "CeloAlfajores" | "Codex" | "CodexSepolia" | "CosmosHub4" | "CosmosIcsTestnet" | "Dogecoin" | "DogecoinTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "EthereumHoodi" | "FantomOpera" | "FantomTestnet" | "FlareC" | "FlareCCoston2" | "Hedera" | "HederaTestnet" | "Ink" | "InkSepolia" | "InternetComputer" | "Ion" | "IonTestnet" | "Iota" | "IotaTestnet" | "IotaZodianet" | "KadenaTestnet4" | "KadenaTestnet4:1" | "KadenaTestnet4:2" | "KadenaTestnet4:3" | "KadenaTestnet4:4" | "KadenaTestnet4:5" | "KadenaTestnet4:6" | "KadenaTestnet4:7" | "KadenaTestnet4:8" | "KadenaTestnet4:9" | "KadenaTestnet4:10" | "KadenaTestnet4:11" | "KadenaTestnet4:12" | "KadenaTestnet4:13" | "KadenaTestnet4:14" | "KadenaTestnet4:15" | "KadenaTestnet4:16" | "KadenaTestnet4:17" | "KadenaTestnet4:18" | "KadenaTestnet4:19" | "Kadena" | "Kadena:1" | "Kadena:2" | "Kadena:3" | "Kadena:4" | "Kadena:5" | "Kadena:6" | "Kadena:7" | "Kadena:8" | "Kadena:9" | "Kadena:10" | "Kadena:11" | "Kadena:12" | "Kadena:13" | "Kadena:14" | "Kadena:15" | "Kadena:16" | "Kadena:17" | "Kadena:18" | "Kadena:19" | "Kaspa" | "KaspaTestnet11" | "Kusama" | "Litecoin" | "LitecoinTestnet" | "Near" | "NearTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Origyn" | "Plume" | "PlumeSepolia" | "Polkadot" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Polymesh" | "PolymeshTestnet" | "Race" | "RaceSepolia" | "SeiAtlantic2" | "SeiPacific1" | "Solana" | "SolanaDevnet" | "Sonic" | "SonicTestnet" | "Stellar" | "StellarTestnet" | "Sui" | "SuiTestnet" | "Tsc" | "TscTestnet1" | "Tezos" | "TezosGhostnet" | "Ton" | "TonTestnet" | "Tron" | "TronNile" | "Westend" | "XrpLedger" | "XrpLedgerTestnet";
|
|
475
|
+
name?: string | undefined;
|
|
476
|
+
symbol?: string | undefined;
|
|
477
|
+
decimals: number;
|
|
478
|
+
tid?: string | undefined;
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
dateCreated: string;
|
|
482
|
+
}[];
|
|
483
|
+
/** token to use as `paginationToken` to request the next page. */
|
|
484
|
+
nextPageToken?: string | undefined;
|
|
485
|
+
};
|
|
486
|
+
export type ListYieldsRequest = {
|
|
487
|
+
query?: ListYieldsQuery;
|
|
488
|
+
};
|