@abtnode/auth 1.17.3-beta-20251117-230305-4637416e → 1.17.3-beta-20251119-034511-f26047c0

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.
Files changed (2) hide show
  1. package/lib/util/client.js +12 -2
  2. package/package.json +8 -8
@@ -53,6 +53,12 @@ async function migrateAccountByChain({ chainHost, user, wallet, blocklet }) {
53
53
  itx: {
54
54
  address: user.did,
55
55
  pk: user.pk,
56
+ data: {
57
+ type: 'json',
58
+ value: {
59
+ purpose: 'connect-wallet',
60
+ },
61
+ },
56
62
  },
57
63
  },
58
64
  wallet,
@@ -62,7 +68,7 @@ async function migrateAccountByChain({ chainHost, user, wallet, blocklet }) {
62
68
  { tx, wallet },
63
69
  {
64
70
  headers: {
65
- 'x-gas-payer-sig': sign(info.wallet.address, info.wallet.secretKey, { txHash: toTxHash(buffer) }),
71
+ 'x-gas-payer-sig': await sign(info.wallet.address, info.wallet.secretKey, { txHash: toTxHash(buffer) }),
66
72
  'x-gas-payer-pk': info.wallet.publicKey,
67
73
  },
68
74
  }
@@ -98,7 +104,11 @@ async function ensureStakedForGas({ client, chainHost, wallet }) {
98
104
  const { token, txConfig } = result.state;
99
105
  const holding = (account?.tokens || []).find((x) => x.address === token.address);
100
106
  if (toBN(holding?.value || '0').lte(toBN(txConfig.txGas.minStake))) {
101
- throw new Error(`App do not have enough balance to stake for gas on chain: ${chainHost}`);
107
+ logger.warn('app do not have enough balance to stake for gas on chain', {
108
+ chain: chainHost,
109
+ address: wallet.address,
110
+ });
111
+ return;
102
112
  }
103
113
 
104
114
  // @ts-ignore
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.17.3-beta-20251117-230305-4637416e",
6
+ "version": "1.17.3-beta-20251119-034511-f26047c0",
7
7
  "description": "Simple lib to manage auth in ABT Node",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -18,9 +18,9 @@
18
18
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
19
19
  "license": "Apache-2.0",
20
20
  "dependencies": {
21
- "@abtnode/constant": "1.17.3-beta-20251117-230305-4637416e",
22
- "@abtnode/logger": "1.17.3-beta-20251117-230305-4637416e",
23
- "@abtnode/util": "1.17.3-beta-20251117-230305-4637416e",
21
+ "@abtnode/constant": "1.17.3-beta-20251119-034511-f26047c0",
22
+ "@abtnode/logger": "1.17.3-beta-20251119-034511-f26047c0",
23
+ "@abtnode/util": "1.17.3-beta-20251119-034511-f26047c0",
24
24
  "@arcblock/did": "^1.27.7",
25
25
  "@arcblock/did-connect-js": "^1.27.7",
26
26
  "@arcblock/did-ext": "^1.27.7",
@@ -29,10 +29,10 @@
29
29
  "@arcblock/nft-display": "^3.2.6",
30
30
  "@arcblock/validator": "^1.27.7",
31
31
  "@arcblock/vc": "^1.27.7",
32
- "@blocklet/constant": "1.17.3-beta-20251117-230305-4637416e",
32
+ "@blocklet/constant": "1.17.3-beta-20251119-034511-f26047c0",
33
33
  "@blocklet/error": "^0.3.3",
34
- "@blocklet/meta": "1.17.3-beta-20251117-230305-4637416e",
35
- "@blocklet/sdk": "1.17.3-beta-20251117-230305-4637416e",
34
+ "@blocklet/meta": "1.17.3-beta-20251119-034511-f26047c0",
35
+ "@blocklet/sdk": "1.17.3-beta-20251119-034511-f26047c0",
36
36
  "@ocap/client": "^1.27.7",
37
37
  "@ocap/mcrypto": "^1.27.7",
38
38
  "@ocap/util": "^1.27.7",
@@ -55,5 +55,5 @@
55
55
  "devDependencies": {
56
56
  "axios-mock-adapter": "^2.1.0"
57
57
  },
58
- "gitHead": "91bbcd8cfe4db52306f6ce83b90295c296350a7f"
58
+ "gitHead": "7ab331f3b29e171a1e02aca80e73f35b6a161b86"
59
59
  }