@bulletxyz/bullet-sdk 0.34.0-rc.1 → 0.34.0-rc.3

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.
@@ -1816,18 +1816,18 @@ var DEFAULT_TRANSACTION_OPTS = {
1816
1816
  // ID and type
1817
1817
  marketRegistryReverse;
1818
1818
  generationOverride;
1819
- constructor(endpoints, rollup, wallet, delegateeAddress) {
1819
+ constructor(endpoints, rollup, wallet, delegatorAddress) {
1820
1820
  if (!isValidHttpUrl(endpoints.rest))
1821
1821
  throw new Error(`Invalid HTTP URL provided: ${endpoints.rest}`);
1822
- this.endpoint = endpoints.rest, this.rollup = rollup, this.wallet = wallet, this.address = delegateeAddress ?? wallet?.address, endpoints.ws && (this.wsManager = new WebSocketManager(endpoints.ws));
1822
+ this.endpoint = endpoints.rest, this.rollup = rollup, this.wallet = wallet, this.address = delegatorAddress ?? wallet?.address, endpoints.ws && (this.wsManager = new WebSocketManager(endpoints.ws));
1823
1823
  }
1824
1824
  // Static convenience constructors
1825
- static async fromEndpoints(endpoints, wallet, delegateeAddress, txOpts) {
1825
+ static async fromEndpoints(endpoints, wallet, delegatorAddress, txOpts) {
1826
1826
  validateEndpoints(endpoints), console.debug("Endpoints:", endpoints);
1827
1827
  let rollupConfig = {
1828
1828
  url: endpoints.rest,
1829
1829
  getSerializer: /* @__PURE__ */ __name((schema) => new WasmSerializer(schema), "getSerializer")
1830
- }, rollup = await createStandardRollup(rollupConfig), client = new _Client(endpoints, rollup, wallet, delegateeAddress);
1830
+ }, rollup = await createStandardRollup(rollupConfig), client = new _Client(endpoints, rollup, wallet, delegatorAddress);
1831
1831
  if (await client.initializeExchangeInfo(), wallet) {
1832
1832
  let chainId = await client.getChainId();
1833
1833
  console.debug("Chain ID:", chainId), rollupConfig.context = {
@@ -1843,13 +1843,13 @@ var DEFAULT_TRANSACTION_OPTS = {
1843
1843
  }
1844
1844
  return client;
1845
1845
  }
1846
- static async fromNetwork(network, wallet, delegateeAddress, txOpts) {
1846
+ static async fromNetwork(network, wallet, delegatorAddress, txOpts) {
1847
1847
  if (!isNetwork(network))
1848
1848
  throw new Error(`Invalid network: ${network}`);
1849
1849
  return await _Client.fromEndpoints(
1850
1850
  NETWORKS[network],
1851
1851
  wallet,
1852
- delegateeAddress,
1852
+ delegatorAddress,
1853
1853
  txOpts
1854
1854
  );
1855
1855
  }
@@ -2792,6 +2792,44 @@ var DEFAULT_TRANSACTION_OPTS = {
2792
2792
  }
2793
2793
  });
2794
2794
  }
2795
+ async delegateUser(delegate) {
2796
+ return await this.submitTransaction({
2797
+ exchange: {
2798
+ delegate_user: {
2799
+ delegate
2800
+ }
2801
+ }
2802
+ });
2803
+ }
2804
+ async revokeDelegation(delegate) {
2805
+ return await this.submitTransaction({
2806
+ exchange: {
2807
+ revoke_delegation: {
2808
+ delegate
2809
+ }
2810
+ }
2811
+ });
2812
+ }
2813
+ async vaultDelegateUser(vaultAddress, delegate) {
2814
+ return await this.submitTransaction({
2815
+ exchange: {
2816
+ vault_delegate_user: {
2817
+ vault_address: vaultAddress,
2818
+ delegate
2819
+ }
2820
+ }
2821
+ });
2822
+ }
2823
+ async vaultRevokeDelegation(vaultAddress, delegate) {
2824
+ return await this.submitTransaction({
2825
+ exchange: {
2826
+ vault_revoke_delegation: {
2827
+ vault_address: vaultAddress,
2828
+ delegate
2829
+ }
2830
+ }
2831
+ });
2832
+ }
2795
2833
  // ========================================================================
2796
2834
  // Calculation Methods (from ExchangeConnection)
2797
2835
  // ========================================================================