@decibeltrade/sdk 0.3.0 → 0.3.1
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/dist/abi/json/netna.json +22 -10
- package/dist/abi/json/testnet.json +733 -507
- package/dist/admin.d.ts +7 -5
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +30 -11
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +19 -1
- package/dist/read/index.d.ts +2 -0
- package/dist/read/index.d.ts.map +1 -1
- package/dist/read/index.js +4 -1
- package/dist/read/market-depth/market-depth.reader.d.ts +1 -0
- package/dist/read/market-depth/market-depth.reader.d.ts.map +1 -1
- package/dist/read/market-depth/market-depth.types.d.ts +1 -0
- package/dist/read/market-depth/market-depth.types.d.ts.map +1 -1
- package/dist/read/market-depth/market-depth.types.js +1 -0
- package/dist/read/trading-points/trading-points.reader.d.ts +18 -0
- package/dist/read/trading-points/trading-points.reader.d.ts.map +1 -0
- package/dist/read/trading-points/trading-points.reader.js +19 -0
- package/dist/read/trading-points/trading-points.types.d.ts +21 -0
- package/dist/read/trading-points/trading-points.types.d.ts.map +1 -0
- package/dist/read/trading-points/trading-points.types.js +10 -0
- package/dist/read/types.d.ts +1 -0
- package/dist/read/types.d.ts.map +1 -1
- package/dist/read/types.js +1 -0
- package/dist/read/user-notifications/user-notifications.types.d.ts +3 -2
- package/dist/read/user-notifications/user-notifications.types.d.ts.map +1 -1
- package/dist/read/user-open-orders/user-open-orders.reader.d.ts +3 -2
- package/dist/read/user-open-orders/user-open-orders.reader.d.ts.map +1 -1
- package/dist/read/user-open-orders/user-open-orders.reader.js +1 -1
- package/dist/read/user-open-orders/user-open-orders.types.d.ts +9 -6
- package/dist/read/user-open-orders/user-open-orders.types.d.ts.map +1 -1
- package/dist/read/user-open-orders/user-open-orders.types.js +3 -2
- package/dist/read/user-order-history/user-order-history.reader.d.ts +3 -2
- package/dist/read/user-order-history/user-order-history.reader.d.ts.map +1 -1
- package/dist/read/user-order-history/user-order-history.reader.js +1 -1
- package/dist/read/user-order-history/user-order-history.types.d.ts +9 -6
- package/dist/read/user-order-history/user-order-history.types.d.ts.map +1 -1
- package/dist/read/user-order-history/user-order-history.types.js +3 -2
- package/dist/read/vaults/vaults.reader.d.ts +4 -4
- package/dist/read/vaults/vaults.types.d.ts +12 -12
- package/dist/read/vaults/vaults.types.js +3 -3
- package/dist/release-config.d.ts +3 -2
- package/dist/release-config.d.ts.map +1 -1
- package/dist/release-config.js +10 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +13 -6
- package/package.json +1 -1
package/dist/write.js
CHANGED
|
@@ -172,7 +172,7 @@ export class DecibelWriteDex extends BaseSDK {
|
|
|
172
172
|
}
|
|
173
173
|
async triggerMatching({ marketAddr, maxWorkUnit }) {
|
|
174
174
|
const txResponse = await this.sendTx({
|
|
175
|
-
function: `${this.config.deployment.package}::public_apis::
|
|
175
|
+
function: `${this.config.deployment.package}::public_apis::process_perp_market_pending_requests`,
|
|
176
176
|
typeArguments: [],
|
|
177
177
|
functionArguments: [marketAddr, maxWorkUnit],
|
|
178
178
|
});
|
|
@@ -345,11 +345,12 @@ export class DecibelWriteDex extends BaseSDK {
|
|
|
345
345
|
* Create a new vault with optional initial funding
|
|
346
346
|
*/
|
|
347
347
|
async buildCreateVaultTx({ contributionAssetType, vaultName, vaultShareSymbol, vaultShareIconUri = "", vaultShareProjectUri = "", feeBps, feeIntervalS, contributionLockupDurationS, initialFunding = 0, acceptsContributions = false, delegateToCreator = false, signerAddress, vaultDescription, vaultSocialLinks, }) {
|
|
348
|
+
const signerPrimarySubaccount = this.getPrimarySubaccountAddress(signerAddress);
|
|
348
349
|
const transaction = await this.buildTx({
|
|
349
350
|
function: `${this.config.deployment.package}::vault_api::create_and_fund_vault`,
|
|
350
351
|
typeArguments: [],
|
|
351
352
|
functionArguments: [
|
|
352
|
-
|
|
353
|
+
signerPrimarySubaccount,
|
|
353
354
|
contributionAssetType,
|
|
354
355
|
vaultName,
|
|
355
356
|
vaultDescription,
|
|
@@ -372,7 +373,8 @@ export class DecibelWriteDex extends BaseSDK {
|
|
|
372
373
|
function: `${this.config.deployment.package}::vault_api::create_and_fund_vault`,
|
|
373
374
|
typeArguments: [],
|
|
374
375
|
functionArguments: [
|
|
375
|
-
args.subaccountAddr ??
|
|
376
|
+
args.subaccountAddr ??
|
|
377
|
+
this.getPrimarySubaccountAddress((args.accountOverride ?? this.account).accountAddress),
|
|
376
378
|
args.contributionAssetType,
|
|
377
379
|
args.vaultName,
|
|
378
380
|
args.vaultDescription,
|
|
@@ -405,9 +407,14 @@ export class DecibelWriteDex extends BaseSDK {
|
|
|
405
407
|
*/
|
|
406
408
|
async buildDepositToVaultTx({ vaultAddress, amount, signerAddress, }) {
|
|
407
409
|
return await this.buildTx({
|
|
408
|
-
function: `${this.config.deployment.package}::
|
|
410
|
+
function: `${this.config.deployment.package}::dex_accounts_entry::contribute_to_vault`,
|
|
409
411
|
typeArguments: [],
|
|
410
|
-
functionArguments: [
|
|
412
|
+
functionArguments: [
|
|
413
|
+
this.getPrimarySubaccountAddress(signerAddress), // todo - select correct subaccount
|
|
414
|
+
vaultAddress,
|
|
415
|
+
this.config.deployment.usdc,
|
|
416
|
+
amount,
|
|
417
|
+
],
|
|
411
418
|
}, signerAddress);
|
|
412
419
|
}
|
|
413
420
|
async depositToVault(args) {
|
|
@@ -446,7 +453,7 @@ export class DecibelWriteDex extends BaseSDK {
|
|
|
446
453
|
*/
|
|
447
454
|
async buildDelegateDexActionsToTx({ vaultAddress, accountToDelegateTo, signerAddress, expirationTimestampSecs, }) {
|
|
448
455
|
return await this.buildTx({
|
|
449
|
-
function: `${this.config.deployment.package}::
|
|
456
|
+
function: `${this.config.deployment.package}::vault_admin_api::delegate_dex_actions_to`,
|
|
450
457
|
typeArguments: [],
|
|
451
458
|
functionArguments: [vaultAddress, accountToDelegateTo, expirationTimestampSecs],
|
|
452
459
|
}, signerAddress);
|
package/package.json
CHANGED