@imtbl/sdk 0.1.10-alpha → 0.1.10-alpha.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.
@@ -16,7 +16,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
16
16
  chainID,
17
17
  coreContractAddress,
18
18
  registrationContractAddress,
19
- sdkVersion: 'ts-immutable-sdk-0.1.10-alpha',
19
+ sdkVersion: 'ts-immutable-sdk-0.1.10-alpha.1',
20
20
  });
21
21
  /**
22
22
  * Sets `sdkVersion` at the time of build
package/dist/index.cjs CHANGED
@@ -6943,8 +6943,10 @@ class GuardianClient {
6943
6943
  }));
6944
6944
  this.imxEtherAddress = imxEtherAddress;
6945
6945
  }
6946
- async validate({ popupWindowSize, payloadHash }) {
6946
+ loading(popupWindowSize) {
6947
6947
  this.confirmationScreen.loading(popupWindowSize);
6948
+ }
6949
+ async validate({ payloadHash }) {
6948
6950
  const finallyFn = () => {
6949
6951
  this.confirmationScreen.closeWindow();
6950
6952
  };
@@ -7021,6 +7023,7 @@ async function exchangeTransfer$1({ user, starkSigner, request, exchangesApi, })
7021
7023
  const ERC721$1 = 'ERC721';
7022
7024
  async function createOrder$1({ starkSigner, user, request, ordersApi, guardianClient, }) {
7023
7025
  return withPassportError(async () => {
7026
+ guardianClient.loading();
7024
7027
  const { ethAddress } = user.imx;
7025
7028
  const amountSell = request.sell.type === ERC721$1 ? '1' : request.sell.amount;
7026
7029
  const amountBuy = request.buy.type === ERC721$1 ? '1' : request.buy.amount;
@@ -7072,6 +7075,7 @@ async function createOrder$1({ starkSigner, user, request, ordersApi, guardianCl
7072
7075
  }
7073
7076
  async function cancelOrder$1({ user, starkSigner, request, ordersApi, guardianClient, }) {
7074
7077
  return withPassportError(async () => {
7078
+ guardianClient.loading();
7075
7079
  const getSignableCancelOrderRequest = {
7076
7080
  order_id: request.order_id,
7077
7081
  };
@@ -7129,6 +7133,7 @@ async function registerPassport({ ethSigner, starkSigner, usersApi }, authorizat
7129
7133
 
7130
7134
  async function createTrade$1({ request, tradesApi, user, starkSigner, guardianClient, }) {
7131
7135
  return withPassportError(async () => {
7136
+ guardianClient.loading();
7132
7137
  const { ethAddress } = user.imx;
7133
7138
  const getSignableTradeRequest = {
7134
7139
  expiration_timestamp: request.expiration_timestamp,
@@ -7175,6 +7180,7 @@ async function createTrade$1({ request, tradesApi, user, starkSigner, guardianCl
7175
7180
  const ERC721$2 = 'ERC721';
7176
7181
  async function transfer$1({ request, transfersApi, starkSigner, user, guardianClient, }) {
7177
7182
  return withPassportError(async () => {
7183
+ guardianClient.loading();
7178
7184
  const transferAmount = request.type === ERC721$2 ? '1' : request.amount;
7179
7185
  const getSignableTransferRequest = {
7180
7186
  sender: user.imx.ethAddress,
@@ -7220,6 +7226,8 @@ async function transfer$1({ request, transfersApi, starkSigner, user, guardianCl
7220
7226
  }
7221
7227
  async function batchNftTransfer({ user, starkSigner, request, transfersApi, guardianClient, }) {
7222
7228
  return withPassportError(async () => {
7229
+ const popupWindowSize = { width: 480, height: 784 };
7230
+ guardianClient.loading(popupWindowSize);
7223
7231
  const { ethAddress } = user.imx;
7224
7232
  const signableRequests = request.map((nftTransfer) => ({
7225
7233
  amount: '1',
@@ -7241,10 +7249,8 @@ async function batchNftTransfer({ user, starkSigner, request, transfersApi, guar
7241
7249
  const signableResult = await transfersApi.getSignableTransfer({
7242
7250
  getSignableTransferRequestV2,
7243
7251
  }, { headers });
7244
- const popupWindowSize = { width: 480, height: 784 };
7245
7252
  await guardianClient.validate({
7246
7253
  payloadHash: signableResult.data.signable_responses[0]?.payload_hash,
7247
- popupWindowSize,
7248
7254
  });
7249
7255
  const requests = await Promise.all(signableResult.data.signable_responses.map(async (resp) => {
7250
7256
  const starkSignature = await starkSigner.signMessage(resp.payload_hash);
package/dist/index.js CHANGED
@@ -2220,7 +2220,7 @@ class APIError extends Error {
2220
2220
 
2221
2221
  /* eslint-disable implicit-arrow-linebreak */
2222
2222
  const defaultHeaders = {
2223
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.1.10-alpha',
2223
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.1.10-alpha.1',
2224
2224
  };
2225
2225
  /**
2226
2226
  * createAPIConfiguration to create a custom Configuration
@@ -2486,7 +2486,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
2486
2486
  chainID,
2487
2487
  coreContractAddress,
2488
2488
  registrationContractAddress,
2489
- sdkVersion: 'ts-immutable-sdk-0.1.10-alpha',
2489
+ sdkVersion: 'ts-immutable-sdk-0.1.10-alpha.1',
2490
2490
  });
2491
2491
  /**
2492
2492
  * Sets `sdkVersion` at the time of build
@@ -6923,8 +6923,10 @@ class GuardianClient {
6923
6923
  }));
6924
6924
  this.imxEtherAddress = imxEtherAddress;
6925
6925
  }
6926
- async validate({ popupWindowSize, payloadHash }) {
6926
+ loading(popupWindowSize) {
6927
6927
  this.confirmationScreen.loading(popupWindowSize);
6928
+ }
6929
+ async validate({ payloadHash }) {
6928
6930
  const finallyFn = () => {
6929
6931
  this.confirmationScreen.closeWindow();
6930
6932
  };
@@ -7001,6 +7003,7 @@ async function exchangeTransfer$1({ user, starkSigner, request, exchangesApi, })
7001
7003
  const ERC721$1 = 'ERC721';
7002
7004
  async function createOrder$1({ starkSigner, user, request, ordersApi, guardianClient, }) {
7003
7005
  return withPassportError(async () => {
7006
+ guardianClient.loading();
7004
7007
  const { ethAddress } = user.imx;
7005
7008
  const amountSell = request.sell.type === ERC721$1 ? '1' : request.sell.amount;
7006
7009
  const amountBuy = request.buy.type === ERC721$1 ? '1' : request.buy.amount;
@@ -7052,6 +7055,7 @@ async function createOrder$1({ starkSigner, user, request, ordersApi, guardianCl
7052
7055
  }
7053
7056
  async function cancelOrder$1({ user, starkSigner, request, ordersApi, guardianClient, }) {
7054
7057
  return withPassportError(async () => {
7058
+ guardianClient.loading();
7055
7059
  const getSignableCancelOrderRequest = {
7056
7060
  order_id: request.order_id,
7057
7061
  };
@@ -7109,6 +7113,7 @@ async function registerPassport({ ethSigner, starkSigner, usersApi }, authorizat
7109
7113
 
7110
7114
  async function createTrade$1({ request, tradesApi, user, starkSigner, guardianClient, }) {
7111
7115
  return withPassportError(async () => {
7116
+ guardianClient.loading();
7112
7117
  const { ethAddress } = user.imx;
7113
7118
  const getSignableTradeRequest = {
7114
7119
  expiration_timestamp: request.expiration_timestamp,
@@ -7155,6 +7160,7 @@ async function createTrade$1({ request, tradesApi, user, starkSigner, guardianCl
7155
7160
  const ERC721$2 = 'ERC721';
7156
7161
  async function transfer$1({ request, transfersApi, starkSigner, user, guardianClient, }) {
7157
7162
  return withPassportError(async () => {
7163
+ guardianClient.loading();
7158
7164
  const transferAmount = request.type === ERC721$2 ? '1' : request.amount;
7159
7165
  const getSignableTransferRequest = {
7160
7166
  sender: user.imx.ethAddress,
@@ -7200,6 +7206,8 @@ async function transfer$1({ request, transfersApi, starkSigner, user, guardianCl
7200
7206
  }
7201
7207
  async function batchNftTransfer({ user, starkSigner, request, transfersApi, guardianClient, }) {
7202
7208
  return withPassportError(async () => {
7209
+ const popupWindowSize = { width: 480, height: 784 };
7210
+ guardianClient.loading(popupWindowSize);
7203
7211
  const { ethAddress } = user.imx;
7204
7212
  const signableRequests = request.map((nftTransfer) => ({
7205
7213
  amount: '1',
@@ -7221,10 +7229,8 @@ async function batchNftTransfer({ user, starkSigner, request, transfersApi, guar
7221
7229
  const signableResult = await transfersApi.getSignableTransfer({
7222
7230
  getSignableTransferRequestV2,
7223
7231
  }, { headers });
7224
- const popupWindowSize = { width: 480, height: 784 };
7225
7232
  await guardianClient.validate({
7226
7233
  payloadHash: signableResult.data.signable_responses[0]?.payload_hash,
7227
- popupWindowSize,
7228
7234
  });
7229
7235
  const requests = await Promise.all(signableResult.data.signable_responses.map(async (resp) => {
7230
7236
  const starkSignature = await starkSigner.signMessage(resp.payload_hash);
package/dist/passport.js CHANGED
@@ -21,7 +21,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
21
21
  chainID,
22
22
  coreContractAddress,
23
23
  registrationContractAddress,
24
- sdkVersion: 'ts-immutable-sdk-0.1.10-alpha',
24
+ sdkVersion: 'ts-immutable-sdk-0.1.10-alpha.1',
25
25
  });
26
26
  /**
27
27
  * Sets `sdkVersion` at the time of build
@@ -4449,8 +4449,10 @@ class GuardianClient {
4449
4449
  }));
4450
4450
  this.imxEtherAddress = imxEtherAddress;
4451
4451
  }
4452
- async validate({ popupWindowSize, payloadHash }) {
4452
+ loading(popupWindowSize) {
4453
4453
  this.confirmationScreen.loading(popupWindowSize);
4454
+ }
4455
+ async validate({ payloadHash }) {
4454
4456
  const finallyFn = () => {
4455
4457
  this.confirmationScreen.closeWindow();
4456
4458
  };
@@ -4527,6 +4529,7 @@ async function exchangeTransfer({ user, starkSigner, request, exchangesApi, }) {
4527
4529
  const ERC721$1 = 'ERC721';
4528
4530
  async function createOrder({ starkSigner, user, request, ordersApi, guardianClient, }) {
4529
4531
  return withPassportError(async () => {
4532
+ guardianClient.loading();
4530
4533
  const { ethAddress } = user.imx;
4531
4534
  const amountSell = request.sell.type === ERC721$1 ? '1' : request.sell.amount;
4532
4535
  const amountBuy = request.buy.type === ERC721$1 ? '1' : request.buy.amount;
@@ -4578,6 +4581,7 @@ async function createOrder({ starkSigner, user, request, ordersApi, guardianClie
4578
4581
  }
4579
4582
  async function cancelOrder({ user, starkSigner, request, ordersApi, guardianClient, }) {
4580
4583
  return withPassportError(async () => {
4584
+ guardianClient.loading();
4581
4585
  const getSignableCancelOrderRequest = {
4582
4586
  order_id: request.order_id,
4583
4587
  };
@@ -4635,6 +4639,7 @@ async function registerPassport({ ethSigner, starkSigner, usersApi }, authorizat
4635
4639
 
4636
4640
  async function createTrade({ request, tradesApi, user, starkSigner, guardianClient, }) {
4637
4641
  return withPassportError(async () => {
4642
+ guardianClient.loading();
4638
4643
  const { ethAddress } = user.imx;
4639
4644
  const getSignableTradeRequest = {
4640
4645
  expiration_timestamp: request.expiration_timestamp,
@@ -4681,6 +4686,7 @@ async function createTrade({ request, tradesApi, user, starkSigner, guardianClie
4681
4686
  const ERC721 = 'ERC721';
4682
4687
  async function transfer({ request, transfersApi, starkSigner, user, guardianClient, }) {
4683
4688
  return withPassportError(async () => {
4689
+ guardianClient.loading();
4684
4690
  const transferAmount = request.type === ERC721 ? '1' : request.amount;
4685
4691
  const getSignableTransferRequest = {
4686
4692
  sender: user.imx.ethAddress,
@@ -4726,6 +4732,8 @@ async function transfer({ request, transfersApi, starkSigner, user, guardianClie
4726
4732
  }
4727
4733
  async function batchNftTransfer({ user, starkSigner, request, transfersApi, guardianClient, }) {
4728
4734
  return withPassportError(async () => {
4735
+ const popupWindowSize = { width: 480, height: 784 };
4736
+ guardianClient.loading(popupWindowSize);
4729
4737
  const { ethAddress } = user.imx;
4730
4738
  const signableRequests = request.map((nftTransfer) => ({
4731
4739
  amount: '1',
@@ -4747,10 +4755,8 @@ async function batchNftTransfer({ user, starkSigner, request, transfersApi, guar
4747
4755
  const signableResult = await transfersApi.getSignableTransfer({
4748
4756
  getSignableTransferRequestV2,
4749
4757
  }, { headers });
4750
- const popupWindowSize = { width: 480, height: 784 };
4751
4758
  await guardianClient.validate({
4752
4759
  payloadHash: signableResult.data.signable_responses[0]?.payload_hash,
4753
- popupWindowSize,
4754
4760
  });
4755
4761
  const requests = await Promise.all(signableResult.data.signable_responses.map(async (resp) => {
4756
4762
  const starkSignature = await starkSigner.signMessage(resp.payload_hash);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@imtbl/sdk",
3
3
  "description": "Immutable Unified SDK",
4
- "version": "0.1.10-alpha",
4
+ "version": "0.1.10-alpha.1",
5
5
  "author": "Immutable",
6
6
  "bugs": "https://github.com/immutable/ts-immutable-sdk/issues",
7
7
  "dependencies": {