Skip to content

Commit 3d864ec

Browse files
committed
data structure added on docs
1 parent 20a0feb commit 3d864ec

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

crosschain_savings.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ spooke chain:
7070
const to = { "0": "0x2.icon/"+icon_savings };
7171
let sendCallIx = await xcall_program.methods
7272
.sendCall(Buffer.from(envelope), to)...
73+
74+
function getClaimRewardData(
75+
): Uint8Array {
76+
let rlpInput: rlp.Input = [
77+
"xclaimrewards",
78+
];
79+
return rlp.encode(rlpInput);
80+
}
7381
```
7482
### Unlock
7583
To unlock the locked bnUSD:
@@ -97,7 +105,15 @@ To unlock the locked bnUSD:
97105
console.log(Buffer.from(envelope));
98106
let sendCallIx = await xcall_program.methods
99107
.sendCall(Buffer.from(envelope), to)...
100-
108+
function getUnlockData(
109+
amount: number,
110+
): Uint8Array {
111+
let rlpInput: rlp.Input = [
112+
"xunlock",
113+
amount
114+
];
115+
return rlp.encode(rlpInput);
116+
}
101117
```
102118
## USDC Staking feature
103119
USDC staking is a feature in which USDC can be locked to the savings contract to earn the savings
@@ -106,7 +122,7 @@ to the savings contract. When unlocking it user will get bnUSD as normal bnUSD u
106122
savings features enabled even spoke chain USDC can be staked now(example is provided above- any supported
107123
token can be staked now from the spoke chain). In ICON chain it can be done by transfering USDC to `Router`
108124
Contract with following data build with java code for example:
109-
```java
125+
```javascript
110126
public static byte[] tokenData(String method, Map<String, Object> params) {
111127
Map<String, Object> map = new HashMap<>();
112128
map.put("method", method);

0 commit comments

Comments
 (0)