@typus/typus-sdk 1.0.42 → 1.0.43

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.
@@ -18,3 +18,6 @@ export declare const sponsorTransactionBlock: (gaslessTxb: any, sponsor: any, pr
18
18
  export declare const executeSponsorTransactionBlock: (provider: any, sponsoredResponse: any, senderSig: any) => Promise<void>;
19
19
  export declare const sponsorTransactionE2E: (gaslessTxb: any, sponsor: any, provider: any, signer: any, gasBudget: any) => Promise<void>;
20
20
  export declare function getSponsoredDeposit(packageId: string, typeArguments: string[], registry: string, index: string, coins: string[], amount: string, signerAddress: string): Promise<[SponsoredTransaction, Uint8Array]>;
21
+ export declare function getSponsoredCompound(packageId: string, typeArguments: string[], registry: string, index: string, signerAddress: string): Promise<[SponsoredTransaction, Uint8Array]>;
22
+ export declare function getSponsoredNewBid(packageId: string, typeArguments: string[], registry: string, index: string, priceOracle: string, coins: string[], size: string, premium_required: string, // fe float * b_token_decimal
23
+ signerAddress: string): Promise<[SponsoredTransaction, Uint8Array]>;
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.getSponsoredDeposit = exports.sponsorTransactionE2E = exports.executeSponsorTransactionBlock = exports.sponsorTransactionBlock = exports.sponsorRpcClient = void 0;
39
+ exports.getSponsoredNewBid = exports.getSponsoredCompound = exports.getSponsoredDeposit = exports.sponsorTransactionE2E = exports.executeSponsorTransactionBlock = exports.sponsorTransactionBlock = exports.sponsorRpcClient = void 0;
40
40
  var typed_rpc_1 = require("typed-rpc");
41
41
  var sponsorRpcClient = function (sponserRpcUrl) { return (0, typed_rpc_1.rpcClient)(sponserRpcUrl); };
42
42
  exports.sponsorRpcClient = sponsorRpcClient;
@@ -126,6 +126,7 @@ function getSponsoredDeposit(packageId, typeArguments, registry, index, coins, a
126
126
  switch (_a.label) {
127
127
  case 0:
128
128
  jsonData = JSON.stringify({
129
+ functionName: "deposit",
129
130
  packageId: packageId,
130
131
  typeArguments: typeArguments,
131
132
  registry: registry,
@@ -153,3 +154,74 @@ function getSponsoredDeposit(packageId, typeArguments, registry, index, coins, a
153
154
  });
154
155
  }
155
156
  exports.getSponsoredDeposit = getSponsoredDeposit;
157
+ function getSponsoredCompound(packageId, typeArguments, registry, index, signerAddress) {
158
+ return __awaiter(this, void 0, void 0, function () {
159
+ var jsonData, response, data, sponsoredResponse, transactionBlock;
160
+ return __generator(this, function (_a) {
161
+ switch (_a.label) {
162
+ case 0:
163
+ jsonData = JSON.stringify({
164
+ functionName: "compound",
165
+ packageId: packageId,
166
+ typeArguments: typeArguments,
167
+ registry: registry,
168
+ index: index,
169
+ signerAddress: signerAddress,
170
+ });
171
+ return [4 /*yield*/, fetch("https://function-1-jbw5emju3a-uc.a.run.app", {
172
+ method: "POST",
173
+ headers: { "Content-Type": "application/json" },
174
+ body: jsonData,
175
+ })];
176
+ case 1:
177
+ response = _a.sent();
178
+ return [4 /*yield*/, response.json()];
179
+ case 2:
180
+ data = _a.sent();
181
+ console.log(data);
182
+ sponsoredResponse = data[0];
183
+ transactionBlock = Buffer.from(data[1].data);
184
+ return [2 /*return*/, [sponsoredResponse, transactionBlock]];
185
+ }
186
+ });
187
+ });
188
+ }
189
+ exports.getSponsoredCompound = getSponsoredCompound;
190
+ function getSponsoredNewBid(packageId, typeArguments, registry, index, priceOracle, coins, size, premium_required, // fe float * b_token_decimal
191
+ signerAddress) {
192
+ return __awaiter(this, void 0, void 0, function () {
193
+ var jsonData, response, data, sponsoredResponse, transactionBlock;
194
+ return __generator(this, function (_a) {
195
+ switch (_a.label) {
196
+ case 0:
197
+ jsonData = JSON.stringify({
198
+ functionName: "newBid",
199
+ packageId: packageId,
200
+ typeArguments: typeArguments,
201
+ registry: registry,
202
+ index: index,
203
+ priceOracle: priceOracle,
204
+ coins: coins,
205
+ size: size,
206
+ premium_required: premium_required,
207
+ signerAddress: signerAddress,
208
+ });
209
+ return [4 /*yield*/, fetch("https://function-1-jbw5emju3a-uc.a.run.app", {
210
+ method: "POST",
211
+ headers: { "Content-Type": "application/json" },
212
+ body: jsonData,
213
+ })];
214
+ case 1:
215
+ response = _a.sent();
216
+ return [4 /*yield*/, response.json()];
217
+ case 2:
218
+ data = _a.sent();
219
+ console.log(data);
220
+ sponsoredResponse = data[0];
221
+ transactionBlock = Buffer.from(data[1].data);
222
+ return [2 /*return*/, [sponsoredResponse, transactionBlock]];
223
+ }
224
+ });
225
+ });
226
+ }
227
+ exports.getSponsoredNewBid = getSponsoredNewBid;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typus/typus-sdk",
3
3
  "author": "Typus",
4
4
  "description": "typus sdk",
5
- "version": "1.0.42",
5
+ "version": "1.0.43",
6
6
  "dependencies": {
7
7
  "@mysten/sui.js": "^0.34.0",
8
8
  "@types/node": "^17.0.0",