@dedot/contracts 0.16.0 → 0.16.1-next.dd70d277.9
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/cjs/utils/ensure.js +5 -2
- package/package.json +6 -6
- package/utils/ensure.js +5 -2
package/cjs/utils/ensure.js
CHANGED
|
@@ -28,9 +28,12 @@ function ensurePalletPresence(client, registry) {
|
|
|
28
28
|
}
|
|
29
29
|
exports.ensurePalletPresence = ensurePalletPresence;
|
|
30
30
|
async function ensureContractPresence(client, registry, address) {
|
|
31
|
-
const contractInfo = await (() => {
|
|
31
|
+
const contractInfo = await (async () => {
|
|
32
32
|
if (registry.isRevive()) {
|
|
33
|
-
|
|
33
|
+
const accountInfo = await client.query.revive.accountInfoOf(address);
|
|
34
|
+
if (accountInfo?.accountType && accountInfo?.accountType?.type === 'Contract') {
|
|
35
|
+
return accountInfo.accountType.value;
|
|
36
|
+
}
|
|
34
37
|
}
|
|
35
38
|
else {
|
|
36
39
|
return client.query.contracts.contractInfoOf(address);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dedot/contracts",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1-next.dd70d277.9+dd70d277",
|
|
4
4
|
"description": "Delightful ink! Contract APIs",
|
|
5
5
|
"author": "Tung Vu <tung@dedot.dev>",
|
|
6
6
|
"homepage": "https://dedot.dev",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"test": "npx vitest --watch=false"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dedot/api": "0.16.
|
|
22
|
-
"@dedot/codecs": "0.16.
|
|
23
|
-
"@dedot/types": "0.16.
|
|
24
|
-
"@dedot/utils": "0.16.
|
|
21
|
+
"@dedot/api": "0.16.1-next.dd70d277.9+dd70d277",
|
|
22
|
+
"@dedot/codecs": "0.16.1-next.dd70d277.9+dd70d277",
|
|
23
|
+
"@dedot/types": "0.16.1-next.dd70d277.9+dd70d277",
|
|
24
|
+
"@dedot/utils": "0.16.1-next.dd70d277.9+dd70d277",
|
|
25
25
|
"@ethereumjs/rlp": "^10.0.0"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"node": ">=18"
|
|
33
33
|
},
|
|
34
34
|
"license": "Apache-2.0",
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "dd70d2772f30eaa72ec9f61d1af9597211c364c5",
|
|
36
36
|
"module": "./index.js",
|
|
37
37
|
"types": "./index.d.ts",
|
|
38
38
|
"exports": {
|
package/utils/ensure.js
CHANGED
|
@@ -23,9 +23,12 @@ export function ensurePalletPresence(client, registry) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
export async function ensureContractPresence(client, registry, address) {
|
|
26
|
-
const contractInfo = await (() => {
|
|
26
|
+
const contractInfo = await (async () => {
|
|
27
27
|
if (registry.isRevive()) {
|
|
28
|
-
|
|
28
|
+
const accountInfo = await client.query.revive.accountInfoOf(address);
|
|
29
|
+
if (accountInfo?.accountType && accountInfo?.accountType?.type === 'Contract') {
|
|
30
|
+
return accountInfo.accountType.value;
|
|
31
|
+
}
|
|
29
32
|
}
|
|
30
33
|
else {
|
|
31
34
|
return client.query.contracts.contractInfoOf(address);
|