@ensdomains/ensjs 3.0.0 → 3.1.0
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/cjs/clients/decorators/public.js.map +1 -1
- package/dist/cjs/contracts/consts.js +3 -3
- package/dist/cjs/contracts/universalResolver.js +92 -59
- package/dist/cjs/contracts/universalResolver.js.map +1 -1
- package/dist/cjs/errors/version.js +1 -1
- package/dist/cjs/functions/public/_getAbi.js +52 -45
- package/dist/cjs/functions/public/_getAbi.js.map +1 -1
- package/dist/cjs/functions/public/_getAddr.js +30 -23
- package/dist/cjs/functions/public/_getAddr.js.map +1 -1
- package/dist/cjs/functions/public/_getContentHash.js +14 -7
- package/dist/cjs/functions/public/_getContentHash.js.map +1 -1
- package/dist/cjs/functions/public/_getText.js +15 -8
- package/dist/cjs/functions/public/_getText.js.map +1 -1
- package/dist/cjs/functions/public/getAbiRecord.js +13 -5
- package/dist/cjs/functions/public/getAbiRecord.js.map +1 -1
- package/dist/cjs/functions/public/getAddressRecord.js +13 -5
- package/dist/cjs/functions/public/getAddressRecord.js.map +1 -1
- package/dist/cjs/functions/public/getContentHashRecord.js +13 -5
- package/dist/cjs/functions/public/getContentHashRecord.js.map +1 -1
- package/dist/cjs/functions/public/getName.js +53 -35
- package/dist/cjs/functions/public/getName.js.map +1 -1
- package/dist/cjs/functions/public/getRecords.js +164 -161
- package/dist/cjs/functions/public/getRecords.js.map +1 -1
- package/dist/cjs/functions/public/getTextRecord.js +13 -5
- package/dist/cjs/functions/public/getTextRecord.js.map +1 -1
- package/dist/cjs/functions/public/universalWrapper.js +45 -37
- package/dist/cjs/functions/public/universalWrapper.js.map +1 -1
- package/dist/cjs/utils/checkSafeUniversalResolverData.js +35 -0
- package/dist/cjs/utils/checkSafeUniversalResolverData.js.map +1 -0
- package/dist/esm/clients/decorators/public.js.map +1 -1
- package/dist/esm/contracts/consts.js +3 -3
- package/dist/esm/contracts/universalResolver.js +92 -59
- package/dist/esm/contracts/universalResolver.js.map +1 -1
- package/dist/esm/errors/version.js +1 -1
- package/dist/esm/functions/public/_getAbi.js +56 -49
- package/dist/esm/functions/public/_getAbi.js.map +1 -1
- package/dist/esm/functions/public/_getAddr.js +30 -23
- package/dist/esm/functions/public/_getAddr.js.map +1 -1
- package/dist/esm/functions/public/_getContentHash.js +14 -7
- package/dist/esm/functions/public/_getContentHash.js.map +1 -1
- package/dist/esm/functions/public/_getText.js +15 -8
- package/dist/esm/functions/public/_getText.js.map +1 -1
- package/dist/esm/functions/public/getAbiRecord.js +13 -5
- package/dist/esm/functions/public/getAbiRecord.js.map +1 -1
- package/dist/esm/functions/public/getAddressRecord.js +13 -5
- package/dist/esm/functions/public/getAddressRecord.js.map +1 -1
- package/dist/esm/functions/public/getContentHashRecord.js +13 -5
- package/dist/esm/functions/public/getContentHashRecord.js.map +1 -1
- package/dist/esm/functions/public/getName.js +54 -36
- package/dist/esm/functions/public/getName.js.map +1 -1
- package/dist/esm/functions/public/getRecords.js +168 -165
- package/dist/esm/functions/public/getRecords.js.map +1 -1
- package/dist/esm/functions/public/getTextRecord.js +13 -5
- package/dist/esm/functions/public/getTextRecord.js.map +1 -1
- package/dist/esm/functions/public/universalWrapper.js +46 -38
- package/dist/esm/functions/public/universalWrapper.js.map +1 -1
- package/dist/esm/utils/checkSafeUniversalResolverData.js +39 -0
- package/dist/esm/utils/checkSafeUniversalResolverData.js.map +1 -0
- package/dist/types/clients/decorators/public.d.ts +6 -6
- package/dist/types/clients/decorators/public.d.ts.map +1 -1
- package/dist/types/clients/public.d.ts +34 -8
- package/dist/types/clients/public.d.ts.map +1 -1
- package/dist/types/contracts/consts.d.ts +3 -3
- package/dist/types/contracts/universalResolver.d.ts +73 -0
- package/dist/types/contracts/universalResolver.d.ts.map +1 -1
- package/dist/types/errors/version.d.ts +1 -1
- package/dist/types/functions/public/_getAbi.d.ts +3 -1
- package/dist/types/functions/public/_getAbi.d.ts.map +1 -1
- package/dist/types/functions/public/_getAddr.d.ts +3 -1
- package/dist/types/functions/public/_getAddr.d.ts.map +1 -1
- package/dist/types/functions/public/_getContentHash.d.ts +3 -1
- package/dist/types/functions/public/_getContentHash.d.ts.map +1 -1
- package/dist/types/functions/public/_getText.d.ts +3 -1
- package/dist/types/functions/public/_getText.d.ts.map +1 -1
- package/dist/types/functions/public/getAbiRecord.d.ts +8 -5
- package/dist/types/functions/public/getAbiRecord.d.ts.map +1 -1
- package/dist/types/functions/public/getAddressRecord.d.ts +8 -5
- package/dist/types/functions/public/getAddressRecord.d.ts.map +1 -1
- package/dist/types/functions/public/getContentHashRecord.d.ts +7 -4
- package/dist/types/functions/public/getContentHashRecord.d.ts.map +1 -1
- package/dist/types/functions/public/getName.d.ts +9 -3
- package/dist/types/functions/public/getName.d.ts.map +1 -1
- package/dist/types/functions/public/getRecords.d.ts +53 -26
- package/dist/types/functions/public/getRecords.d.ts.map +1 -1
- package/dist/types/functions/public/getTextRecord.d.ts +7 -4
- package/dist/types/functions/public/getTextRecord.d.ts.map +1 -1
- package/dist/types/functions/public/universalWrapper.d.ts +4 -2
- package/dist/types/functions/public/universalWrapper.d.ts.map +1 -1
- package/dist/types/types.d.ts +2 -2
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/checkSafeUniversalResolverData.d.ts +14 -0
- package/dist/types/utils/checkSafeUniversalResolverData.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/clients/decorators/public.ts +31 -4
- package/src/contracts/consts.ts +3 -3
- package/src/contracts/universalResolver.ts +95 -59
- package/src/errors/version.ts +1 -1
- package/src/functions/public/_getAbi.ts +61 -53
- package/src/functions/public/_getAddr.ts +31 -24
- package/src/functions/public/_getContentHash.ts +15 -7
- package/src/functions/public/_getText.ts +16 -8
- package/src/functions/public/getAbiRecord.ts +21 -8
- package/src/functions/public/getAddressRecord.ts +25 -9
- package/src/functions/public/getContentHashRecord.ts +19 -7
- package/src/functions/public/getName.ts +58 -40
- package/src/functions/public/getRecords.ts +336 -235
- package/src/functions/public/getTextRecord.ts +19 -6
- package/src/functions/public/universalWrapper.ts +49 -43
- package/src/types.ts +4 -3
- package/src/utils/checkSafeUniversalResolverData.ts +62 -0
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { BaseError, type Address, type Hex } from 'viem';
|
|
2
2
|
import type { ClientWithEns } from '../../contracts/consts.js';
|
|
3
|
-
import type { DecodedAddr, DecodedText, SimpleTransactionRequest, TransactionRequestWithPassthrough } from '../../types.js';
|
|
3
|
+
import type { DecodedAddr, DecodedText, Prettify, SimpleTransactionRequest, TransactionRequestWithPassthrough } from '../../types.js';
|
|
4
4
|
import { type InternalGetAbiReturnType } from './_getAbi.js';
|
|
5
5
|
import { type InternalGetContentHashReturnType } from './_getContentHash.js';
|
|
6
|
-
export type GetRecordsParameters = {
|
|
6
|
+
export type GetRecordsParameters<TTexts extends readonly string[] | undefined = readonly string[], TCoins extends readonly (string | number)[] | undefined = readonly (string | number)[], TContentHash extends boolean | undefined = true, TAbi extends boolean | undefined = true> = {
|
|
7
7
|
/** Name to get records for */
|
|
8
8
|
name: string;
|
|
9
|
+
/** Text record key array */
|
|
10
|
+
texts?: TTexts;
|
|
11
|
+
/** Coin record id/symbol array */
|
|
12
|
+
coins?: TCoins;
|
|
13
|
+
/** If true, will fetch content hash */
|
|
14
|
+
contentHash?: TContentHash;
|
|
15
|
+
/** If true, will fetch ABI */
|
|
16
|
+
abi?: TAbi;
|
|
9
17
|
/** Optional specific resolver address, for fallback or for all results */
|
|
10
18
|
resolver?: {
|
|
11
19
|
/** Resolver address */
|
|
@@ -13,17 +21,8 @@ export type GetRecordsParameters = {
|
|
|
13
21
|
/** If true, will only use resolver if main fetch fails */
|
|
14
22
|
fallbackOnly?: boolean;
|
|
15
23
|
};
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
/** Text record key array */
|
|
19
|
-
texts?: string[];
|
|
20
|
-
/** Coin record id/symbol array */
|
|
21
|
-
coins?: (string | number)[];
|
|
22
|
-
/** If true, will fetch content hash */
|
|
23
|
-
contentHash?: boolean;
|
|
24
|
-
/** If true, will fetch ABI */
|
|
25
|
-
abi?: boolean;
|
|
26
|
-
};
|
|
24
|
+
/** Batch gateway URLs to use for resolving CCIP-read requests. */
|
|
25
|
+
gatewayUrls?: string[];
|
|
27
26
|
};
|
|
28
27
|
type WithContentHashResult = {
|
|
29
28
|
/** Retrieved content hash record for name */
|
|
@@ -41,30 +40,52 @@ type WithCoinsResult = {
|
|
|
41
40
|
/** Retrieved coins for name */
|
|
42
41
|
coins: DecodedAddr[];
|
|
43
42
|
};
|
|
44
|
-
type
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
export type GetRecordsReturnType<TParams extends GetRecordsParameters = GetRecordsParameters> = TParams['records'] extends undefined ? BaseGetRecordsReturnType : (TParams['records']['contentHash'] extends true ? WithContentHashResult : {}) & (TParams['records']['abi'] extends true ? WithAbiResult : {}) & (TParams['records']['texts'] extends string[] ? WithTextsResult : {}) & (TParams['records']['coins'] extends (string | number)[] ? WithCoinsResult : {}) & {
|
|
43
|
+
export type GetRecordsReturnType<TTexts extends readonly string[] = readonly [string, ...string[]], TCoins extends readonly (string | number)[] = readonly [
|
|
44
|
+
string | number,
|
|
45
|
+
...(string | number)[]
|
|
46
|
+
], TContentHash extends boolean = true, TAbi extends boolean = true> = Prettify<(TContentHash extends true ? WithContentHashResult : {}) & (TAbi extends true ? WithAbiResult : {}) & (TTexts extends readonly [string, ...string[]] ? WithTextsResult : {}) & (TCoins extends readonly [string | number, ...(string | number)[]] ? WithCoinsResult : {}) & {
|
|
49
47
|
/** Resolver address used for fetch */
|
|
50
48
|
resolverAddress: Address;
|
|
51
|
-
}
|
|
49
|
+
}>;
|
|
52
50
|
type CallObj = {
|
|
51
|
+
key: string;
|
|
52
|
+
call: SimpleTransactionRequest;
|
|
53
|
+
type: 'text';
|
|
54
|
+
} | {
|
|
53
55
|
key: string | number;
|
|
54
56
|
call: SimpleTransactionRequest;
|
|
55
|
-
type: 'coin'
|
|
57
|
+
type: 'coin';
|
|
58
|
+
} | {
|
|
59
|
+
key: 'contentHash';
|
|
60
|
+
call: SimpleTransactionRequest;
|
|
61
|
+
type: 'contentHash';
|
|
62
|
+
} | {
|
|
63
|
+
key: 'abi';
|
|
64
|
+
call: SimpleTransactionRequest;
|
|
65
|
+
type: 'abi';
|
|
56
66
|
};
|
|
57
|
-
|
|
58
|
-
|
|
67
|
+
type EncodeReturnType = Required<TransactionRequestWithPassthrough<{
|
|
68
|
+
calls: (CallObj | null)[];
|
|
69
|
+
address?: Address;
|
|
70
|
+
args?: any;
|
|
71
|
+
}>>;
|
|
72
|
+
declare const encode: (client: ClientWithEns, { name, resolver, texts, coins, contentHash, abi, gatewayUrls, }: GetRecordsParameters) => EncodeReturnType;
|
|
73
|
+
declare const decode: <const TTexts extends readonly string[] = readonly string[], const TCoins extends readonly (string | number)[] = readonly (string | number)[], const TContentHash extends boolean = true, const TAbi extends boolean = true>(client: ClientWithEns, data: Hex | BaseError, passthrough: EncodeReturnType['passthrough'], { resolver, texts, coins, contentHash, abi, }: GetRecordsParameters<TTexts, TCoins, TContentHash, TAbi>) => Promise<(TContentHash extends true ? WithContentHashResult : {}) & (TAbi extends true ? WithAbiResult : {}) & (TTexts extends readonly [string, ...string[]] ? WithTextsResult : {}) & (TCoins extends readonly [string | number, ...(string | number)[]] ? WithCoinsResult : {}) & {
|
|
74
|
+
/** Resolver address used for fetch */
|
|
75
|
+
resolverAddress: Address;
|
|
76
|
+
} extends infer T ? { [K in keyof T]: ((TContentHash extends true ? WithContentHashResult : {}) & (TAbi extends true ? WithAbiResult : {}) & (TTexts extends readonly [string, ...string[]] ? WithTextsResult : {}) & (TCoins extends readonly [string | number, ...(string | number)[]] ? WithCoinsResult : {}) & {
|
|
77
|
+
/** Resolver address used for fetch */
|
|
78
|
+
resolverAddress: Address;
|
|
79
|
+
})[K]; } : never>;
|
|
59
80
|
type EncoderFunction = typeof encode;
|
|
60
81
|
type DecoderFunction = typeof decode<any>;
|
|
61
82
|
type BatchableFunctionObject = {
|
|
62
83
|
encode: EncoderFunction;
|
|
63
84
|
decode: DecoderFunction;
|
|
64
|
-
batch: <
|
|
65
|
-
args: [
|
|
85
|
+
batch: <const TTexts extends readonly string[] = readonly string[], const TCoins extends readonly (string | number)[] = readonly (string | number)[], const TContentHash extends boolean = true, const TAbi extends boolean = true>(args: GetRecordsParameters<TTexts, TCoins, TContentHash, TAbi>) => {
|
|
86
|
+
args: [GetRecordsParameters<TTexts, TCoins, TContentHash, TAbi>];
|
|
66
87
|
encode: EncoderFunction;
|
|
67
|
-
decode: typeof decode<
|
|
88
|
+
decode: typeof decode<TTexts, TCoins, TContentHash, TAbi>;
|
|
68
89
|
};
|
|
69
90
|
};
|
|
70
91
|
/**
|
|
@@ -93,6 +114,12 @@ type BatchableFunctionObject = {
|
|
|
93
114
|
* })
|
|
94
115
|
* // { texts: [{ key: 'com.twitter', value: 'ensdomains' }, { key: 'com.github', value: 'ensdomains' }], coins: [{ id: 60, name: 'ETH', value: '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7' }], contentHash: { protocolType: 'ipns', decoded: 'k51qzi5uqu5djdczd6zw0grmo23j2vkj9uzvujencg15s5rlkq0ss4ivll8wqw' } }
|
|
95
116
|
*/
|
|
96
|
-
declare const getRecords: (<
|
|
117
|
+
declare const getRecords: (<const TTexts extends readonly string[] = readonly string[], const TCoins extends readonly (string | number)[] = readonly (string | number)[], const TContentHash extends boolean = true, const TAbi extends boolean = true>(client: ClientWithEns, { name, texts, coins, contentHash, abi, resolver, gatewayUrls, }: GetRecordsParameters<TTexts, TCoins, TContentHash, TAbi>) => Promise<(TContentHash extends true ? WithContentHashResult : {}) & (TAbi extends true ? WithAbiResult : {}) & (TTexts extends readonly [string, ...string[]] ? WithTextsResult : {}) & (TCoins extends readonly [string | number, ...(string | number)[]] ? WithCoinsResult : {}) & {
|
|
118
|
+
/** Resolver address used for fetch */
|
|
119
|
+
resolverAddress: Address;
|
|
120
|
+
} extends infer T ? { [K in keyof T]: ((TContentHash extends true ? WithContentHashResult : {}) & (TAbi extends true ? WithAbiResult : {}) & (TTexts extends readonly [string, ...string[]] ? WithTextsResult : {}) & (TCoins extends readonly [string | number, ...(string | number)[]] ? WithCoinsResult : {}) & {
|
|
121
|
+
/** Resolver address used for fetch */
|
|
122
|
+
resolverAddress: Address;
|
|
123
|
+
})[K]; } : never>) & BatchableFunctionObject;
|
|
97
124
|
export default getRecords;
|
|
98
125
|
//# sourceMappingURL=getRecords.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRecords.d.ts","sourceRoot":"","sources":["../../../../src/functions/public/getRecords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,
|
|
1
|
+
{"version":3,"file":"getRecords.d.ts","sourceRoot":"","sources":["../../../../src/functions/public/getRecords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAMT,KAAK,OAAO,EACZ,KAAK,GAAG,EACT,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAG9D,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,QAAQ,EACR,wBAAwB,EACxB,iCAAiC,EAClC,MAAM,gBAAgB,CAAA;AAKvB,OAAgB,EAAE,KAAK,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAErE,OAAwB,EACtB,KAAK,gCAAgC,EACtC,MAAM,sBAAsB,CAAA;AAI7B,MAAM,MAAM,oBAAoB,CAC9B,MAAM,SAAS,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,SAAS,MAAM,EAAE,EAChE,MAAM,SAAS,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,SAAS,GAAG,SAAS,CAC/D,MAAM,GACN,MAAM,CACT,EAAE,EACH,YAAY,SAAS,OAAO,GAAG,SAAS,GAAG,IAAI,EAC/C,IAAI,SAAS,OAAO,GAAG,SAAS,GAAG,IAAI,IAC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iBAyU7B,CAAA;AAED,KAAK,eAAe,GAAG,OAAO,MAAM,CAAA;AACpC,KAAK,eAAe,GAAG,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;AAEzC,KAAK,uBAAuB,GAAG;IAC7B,MAAM,EAAE,eAAe,CAAA;IACvB,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,CACL,KAAK,CAAC,MAAM,SAAS,SAAS,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,EAC1D,KAAK,CAAC,MAAM,SAAS,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,SAAS,CACzD,MAAM,GACN,MAAM,CACT,EAAE,EACH,KAAK,CAAC,YAAY,SAAS,OAAO,GAAG,IAAI,EACzC,KAAK,CAAC,IAAI,SAAS,OAAO,GAAG,IAAI,EAEjC,IAAI,EAAE,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,KAC3D;QACH,IAAI,EAAE,CAAC,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC,CAAA;QAChE,MAAM,EAAE,eAAe,CAAA;QACvB,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;KAC1D,CAAA;CACF,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,QAAA,MAAM,UAAU,wOASN,aAAa;IAtYjB,sCAAsC;qBACrB,OAAO;;IADxB,sCAAsC;qBACrB,OAAO;4CAgZL,CAAA;AAEzB,eAAe,UAAU,CAAA"}
|
|
@@ -3,10 +3,13 @@ import type { ClientWithEns } from '../../contracts/consts.js';
|
|
|
3
3
|
import type { GenericPassthrough, Prettify, SimpleTransactionRequest } from '../../types.js';
|
|
4
4
|
import { type GeneratedFunction } from '../../utils/generateFunction.js';
|
|
5
5
|
import { type InternalGetTextParameters, type InternalGetTextReturnType } from './_getText.js';
|
|
6
|
-
export type GetTextRecordParameters = Prettify<InternalGetTextParameters
|
|
6
|
+
export type GetTextRecordParameters = Prettify<InternalGetTextParameters & {
|
|
7
|
+
/** Batch gateway URLs to use for resolving CCIP-read requests. */
|
|
8
|
+
gatewayUrls?: string[];
|
|
9
|
+
}>;
|
|
7
10
|
export type GetTextRecordReturnType = Prettify<InternalGetTextReturnType>;
|
|
8
|
-
declare const encode: (client: ClientWithEns, { name, key }: GetTextRecordParameters) => SimpleTransactionRequest;
|
|
9
|
-
declare const decode: (client: ClientWithEns, data: Hex | BaseError, passthrough: GenericPassthrough) => Promise<GetTextRecordReturnType>;
|
|
11
|
+
declare const encode: (client: ClientWithEns, { name, key, gatewayUrls }: Omit<GetTextRecordParameters, 'strict'>) => SimpleTransactionRequest;
|
|
12
|
+
declare const decode: (client: ClientWithEns, data: Hex | BaseError, passthrough: GenericPassthrough, { strict }: Pick<GetTextRecordParameters, 'strict'>) => Promise<GetTextRecordReturnType>;
|
|
10
13
|
type BatchableFunctionObject = GeneratedFunction<typeof encode, typeof decode>;
|
|
11
14
|
/**
|
|
12
15
|
* Gets a text record for a name.
|
|
@@ -27,6 +30,6 @@ type BatchableFunctionObject = GeneratedFunction<typeof encode, typeof decode>;
|
|
|
27
30
|
* const result = await getTextRecord(client, { name: 'ens.eth', key: 'com.twitter' })
|
|
28
31
|
* // ensdomains
|
|
29
32
|
*/
|
|
30
|
-
declare const getTextRecord: ((client: ClientWithEns, { name, key }: GetTextRecordParameters) => Promise<GetTextRecordReturnType>) & BatchableFunctionObject;
|
|
33
|
+
declare const getTextRecord: ((client: ClientWithEns, { name, key, strict }: GetTextRecordParameters) => Promise<GetTextRecordReturnType>) & BatchableFunctionObject;
|
|
31
34
|
export default getTextRecord;
|
|
32
35
|
//# sourceMappingURL=getTextRecord.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTextRecord.d.ts","sourceRoot":"","sources":["../../../../src/functions/public/getTextRecord.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EACV,kBAAkB,EAClB,QAAQ,EACR,wBAAwB,EACzB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,iCAAiC,CAAA;AACxC,OAAiB,EACf,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC/B,MAAM,eAAe,CAAA;AAGtB,MAAM,MAAM,uBAAuB,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"getTextRecord.d.ts","sourceRoot":"","sources":["../../../../src/functions/public/getTextRecord.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EACV,kBAAkB,EAClB,QAAQ,EACR,wBAAwB,EACzB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,iCAAiC,CAAA;AACxC,OAAiB,EACf,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC/B,MAAM,eAAe,CAAA;AAGtB,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAC5C,yBAAyB,GAAG;IAC1B,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB,CACF,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC,yBAAyB,CAAC,CAAA;AAEzE,QAAA,MAAM,MAAM,WACF,aAAa,8BACO,KAAK,uBAAuB,EAAE,QAAQ,CAAC,KAClE,wBAOF,CAAA;AAED,QAAA,MAAM,MAAM,WACF,aAAa,QACf,GAAG,GAAG,SAAS,eACR,kBAAkB,cACnB,KAAK,uBAAuB,EAAE,QAAQ,CAAC,KAClD,QAAQ,uBAAuB,CAMjC,CAAA;AAED,KAAK,uBAAuB,GAAG,iBAAiB,CAAC,OAAO,MAAM,EAAE,OAAO,MAAM,CAAC,CAAA;AAE9E;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,aAAa,YACT,aAAa,yBACE,uBAAuB,KAC3C,QAAQ,uBAAuB,CAAC,2BACZ,CAAA;AAEzB,eAAe,aAAa,CAAA"}
|
|
@@ -4,11 +4,13 @@ import type { GenericPassthrough, TransactionRequestWithPassthrough } from '../.
|
|
|
4
4
|
export type UniversalWrapperParameters = {
|
|
5
5
|
name: string;
|
|
6
6
|
data: Hex;
|
|
7
|
+
strict?: boolean;
|
|
8
|
+
gatewayUrls?: string[];
|
|
7
9
|
};
|
|
8
10
|
export type UniversalWrapperReturnType = {
|
|
9
11
|
data: Hex;
|
|
10
12
|
resolver: Address;
|
|
11
|
-
};
|
|
12
|
-
declare const universalWrapper: import("../../utils/generateFunction.js").GeneratedFunction<(client: ClientWithEns, { name, data }: UniversalWrapperParameters) => TransactionRequestWithPassthrough, (_client: ClientWithEns, data: Hex | BaseError, passthrough: GenericPassthrough) => Promise<UniversalWrapperReturnType>>;
|
|
13
|
+
} | null;
|
|
14
|
+
declare const universalWrapper: import("../../utils/generateFunction.js").GeneratedFunction<(client: ClientWithEns, { name, data, gatewayUrls }: Omit<UniversalWrapperParameters, 'strict'>) => TransactionRequestWithPassthrough, (_client: ClientWithEns, data: Hex | BaseError, passthrough: GenericPassthrough, { strict }: Pick<UniversalWrapperParameters, 'strict'>) => Promise<UniversalWrapperReturnType>>;
|
|
13
15
|
export default universalWrapper;
|
|
14
16
|
//# sourceMappingURL=universalWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"universalWrapper.d.ts","sourceRoot":"","sources":["../../../../src/functions/public/universalWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,
|
|
1
|
+
{"version":3,"file":"universalWrapper.d.ts","sourceRoot":"","sources":["../../../../src/functions/public/universalWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAMT,KAAK,OAAO,EACZ,KAAK,GAAG,EACT,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAG9D,OAAO,KAAK,EACV,kBAAkB,EAClB,iCAAiC,EAClC,MAAM,gBAAgB,CAAA;AAMvB,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,GAAG,CAAA;IACT,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,GAAG,CAAA;IACT,QAAQ,EAAE,OAAO,CAAA;CAClB,GAAG,IAAI,CAAA;AA+ER,QAAA,MAAM,gBAAgB,uEA5EZ,aAAa,+BACQ,KAAK,0BAA0B,EAAE,QAAQ,CAAC,KACtE,iCAAiC,YA8CzB,aAAa,QAChB,GAAG,GAAG,SAAS,eACR,kBAAkB,cACnB,KAAK,0BAA0B,EAAE,QAAQ,CAAC,KACrD,QAAQ,0BAA0B,CAAC,CAwBuB,CAAA;AAE7D,eAAe,gBAAgB,CAAA"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export type Prettify<T> = {
|
|
|
6
6
|
export type SimpleTransactionRequest = {
|
|
7
7
|
[P in keyof Pick<TransactionRequest, 'to' | 'data'>]-?: Exclude<TransactionRequest[P], null>;
|
|
8
8
|
};
|
|
9
|
-
export type TransactionRequestWithPassthrough = SimpleTransactionRequest & {
|
|
10
|
-
passthrough?:
|
|
9
|
+
export type TransactionRequestWithPassthrough<TPassthrough = any> = SimpleTransactionRequest & {
|
|
10
|
+
passthrough?: TPassthrough;
|
|
11
11
|
};
|
|
12
12
|
export type GenericPassthrough = {
|
|
13
13
|
args: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,MAAM,EACN,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KACvB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GAAG,EAAE,CAAA;AAEN,MAAM,MAAM,wBAAwB,GAAG;KACpC,CAAC,IAAI,MAAM,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAC7D,kBAAkB,CAAC,CAAC,CAAC,EACrB,IAAI,CACL;CACF,CAAA;AAED,MAAM,MAAM,iCAAiC,GAAG,wBAAwB,GAAG;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,MAAM,EACN,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KACvB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GAAG,EAAE,CAAA;AAEN,MAAM,MAAM,wBAAwB,GAAG;KACpC,CAAC,IAAI,MAAM,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAC7D,kBAAkB,CAAC,CAAC,CAAC,EACrB,IAAI,CACL;CACF,CAAA;AAED,MAAM,MAAM,iCAAiC,CAAC,YAAY,GAAG,GAA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,OAAO,SAAS,YAAY,GACzE,qBAAqB,GACrB,OAAO,SAAS,YAAY,GAC5B,qBAAqB,GACrB,gBAAgB,CAAA;AAEpB,MAAM,MAAM,WAAW,CAAC,OAAO,SAAS,MAAM,IAAI,OAAO,SAAS,QAAQ,GACtE,iBAAiB,GACjB,OAAO,SAAS,UAAU,GAC1B,cAAc,CAAC,OAAO,CAAC,GACvB,gBAAgB,CAAC,OAAO,CAAC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getContractError, type BaseError, type Hex } from 'viem';
|
|
2
|
+
import type { Prettify } from '../types.js';
|
|
3
|
+
type CheckSafeUniversalResolverDataParameters = Prettify<{
|
|
4
|
+
strict: boolean | undefined;
|
|
5
|
+
args: any[] | (() => any[]);
|
|
6
|
+
} & Omit<Parameters<typeof getContractError>[1], 'args'>>;
|
|
7
|
+
/**
|
|
8
|
+
* Checks if the data returned from a universal resolver is safe to use, or if it is a known revert error
|
|
9
|
+
* @param parameters - {@link CheckSafeUniversalResolverDataParameters}
|
|
10
|
+
* @returns `true` if the data is safe to use, `false` if it is a known revert error, or throws if it is an unknown error
|
|
11
|
+
*/
|
|
12
|
+
export declare const checkSafeUniversalResolverData: (data: Hex | BaseError, { strict, abi, args, functionName, address, docsPath, sender, }: CheckSafeUniversalResolverDataParameters) => data is `0x${string}`;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=checkSafeUniversalResolverData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkSafeUniversalResolverData.d.ts","sourceRoot":"","sources":["../../../src/utils/checkSafeUniversalResolverData.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAChB,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG3C,KAAK,wCAAwC,GAAG,QAAQ,CACtD;IACE,MAAM,EAAE,OAAO,GAAG,SAAS,CAAA;IAC3B,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;CAC5B,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CACzD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,SACnC,GAAG,GAAG,SAAS,mEASlB,wCAAwC,0BA6B5C,CAAA"}
|
package/package.json
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"description": "ENS javascript library for contract interaction",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@adraffy/ens-normalize": "1.9.0",
|
|
6
|
-
"@ensdomains/address-encoder": "1.0.0-rc.
|
|
7
|
-
"@ensdomains/content-hash": "3.1.0-rc.
|
|
8
|
-
"@ensdomains/dnsprovejs": "^0.5.
|
|
6
|
+
"@ensdomains/address-encoder": "1.0.0-rc.3",
|
|
7
|
+
"@ensdomains/content-hash": "3.1.0-rc.1",
|
|
8
|
+
"@ensdomains/dnsprovejs": "^0.5.1",
|
|
9
9
|
"abitype": "^0.8.0",
|
|
10
10
|
"dns-packet": "^5.3.1",
|
|
11
11
|
"graphql": "^16.3.0",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"viem": "^1.16.4"
|
|
18
18
|
},
|
|
19
|
-
"version": "3.
|
|
19
|
+
"version": "3.1.0",
|
|
20
20
|
"files": [
|
|
21
21
|
"dist/",
|
|
22
22
|
"src/",
|
|
@@ -100,6 +100,8 @@ export type EnsPublicActions = {
|
|
|
100
100
|
*/
|
|
101
101
|
getAbiRecord: ({
|
|
102
102
|
name,
|
|
103
|
+
gatewayUrls,
|
|
104
|
+
strict,
|
|
103
105
|
}: GetAbiRecordParameters) => Promise<GetAbiRecordReturnType>
|
|
104
106
|
/**
|
|
105
107
|
* Gets an address record for a name and specified coin
|
|
@@ -122,6 +124,8 @@ export type EnsPublicActions = {
|
|
|
122
124
|
name,
|
|
123
125
|
coin,
|
|
124
126
|
bypassFormat,
|
|
127
|
+
gatewayUrls,
|
|
128
|
+
strict,
|
|
125
129
|
}: GetAddressRecordParameters) => Promise<GetAddressRecordReturnType>
|
|
126
130
|
/**
|
|
127
131
|
* Gets the availability of a name to register
|
|
@@ -162,6 +166,8 @@ export type EnsPublicActions = {
|
|
|
162
166
|
*/
|
|
163
167
|
getContentHashRecord: ({
|
|
164
168
|
name,
|
|
169
|
+
gatewayUrls,
|
|
170
|
+
strict,
|
|
165
171
|
}: GetContentHashRecordParameters) => Promise<GetContentHashRecordReturnType>
|
|
166
172
|
/**
|
|
167
173
|
* Gets the expiry for a name
|
|
@@ -201,7 +207,12 @@ export type EnsPublicActions = {
|
|
|
201
207
|
* const result = await client.getName({ address: '0xb8c2C29ee19D8307cb7255e1Cd9CbDE883A267d5' })
|
|
202
208
|
* // { name: 'nick.eth', match: true, reverseResolverAddress: '0xa2c122be93b0074270ebee7f6b7292c7deb45047', resolverAddress: '0x4976fb03c32e5b8cfe2b6ccb31c09ba78ebaba41' }
|
|
203
209
|
*/
|
|
204
|
-
getName: ({
|
|
210
|
+
getName: ({
|
|
211
|
+
address,
|
|
212
|
+
allowMismatch,
|
|
213
|
+
gatewayUrls,
|
|
214
|
+
strict,
|
|
215
|
+
}: GetNameParameters) => Promise<GetNameReturnType>
|
|
205
216
|
/**
|
|
206
217
|
* Gets the owner(s) of a name.
|
|
207
218
|
* @param parameters - {@link GetOwnerParameters}
|
|
@@ -268,11 +279,25 @@ export type EnsPublicActions = {
|
|
|
268
279
|
* })
|
|
269
280
|
* // { texts: [{ key: 'com.twitter', value: 'ensdomains' }, { key: 'com.github', value: 'ensdomains' }], coins: [{ id: 60, name: 'ETH', value: '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7' }], contentHash: { protocolType: 'ipns', decoded: 'k51qzi5uqu5djdczd6zw0grmo23j2vkj9uzvujencg15s5rlkq0ss4ivll8wqw' } }
|
|
270
281
|
*/
|
|
271
|
-
getRecords:
|
|
282
|
+
getRecords: <
|
|
283
|
+
const TTexts extends readonly string[] = readonly string[],
|
|
284
|
+
const TCoins extends readonly (string | number)[] = readonly (
|
|
285
|
+
| string
|
|
286
|
+
| number
|
|
287
|
+
)[],
|
|
288
|
+
const TContentHash extends boolean = true,
|
|
289
|
+
const TAbi extends boolean = true,
|
|
290
|
+
>({
|
|
272
291
|
name,
|
|
273
|
-
|
|
292
|
+
texts,
|
|
293
|
+
coins,
|
|
294
|
+
contentHash,
|
|
295
|
+
abi,
|
|
274
296
|
resolver,
|
|
275
|
-
|
|
297
|
+
gatewayUrls,
|
|
298
|
+
}: GetRecordsParameters<TTexts, TCoins, TContentHash, TAbi>) => Promise<
|
|
299
|
+
GetRecordsReturnType<TTexts, TCoins, TContentHash, TAbi>
|
|
300
|
+
>
|
|
276
301
|
/**
|
|
277
302
|
* Gets the resolver address for a name.
|
|
278
303
|
* @param parameters - {@link GetResolverParameters}
|
|
@@ -313,6 +338,8 @@ export type EnsPublicActions = {
|
|
|
313
338
|
getTextRecord: ({
|
|
314
339
|
name,
|
|
315
340
|
key,
|
|
341
|
+
gatewayUrls,
|
|
342
|
+
strict,
|
|
316
343
|
}: GetTextRecordParameters) => Promise<GetTextRecordReturnType>
|
|
317
344
|
/**
|
|
318
345
|
* Gets the wrapper data for a name.
|
package/src/contracts/consts.ts
CHANGED
|
@@ -59,7 +59,7 @@ export const addresses = {
|
|
|
59
59
|
address: '0x21745FF62108968fBf5aB1E07961CC0FCBeB2364',
|
|
60
60
|
},
|
|
61
61
|
ensUniversalResolver: {
|
|
62
|
-
address: '
|
|
62
|
+
address: '0x8cab227b1162f03b8338331adaad7aadc83b895e',
|
|
63
63
|
},
|
|
64
64
|
},
|
|
65
65
|
goerli: {
|
|
@@ -91,7 +91,7 @@ export const addresses = {
|
|
|
91
91
|
address: '0xF427c4AdED8B6dfde604865c1a7E953B160C26f0',
|
|
92
92
|
},
|
|
93
93
|
ensUniversalResolver: {
|
|
94
|
-
address: '
|
|
94
|
+
address: '0xfc4AC75C46C914aF5892d6d3eFFcebD7917293F1',
|
|
95
95
|
},
|
|
96
96
|
},
|
|
97
97
|
sepolia: {
|
|
@@ -123,7 +123,7 @@ export const addresses = {
|
|
|
123
123
|
address: '0x7b3ada1c8f012bae747cf99d6cbbf70d040b84cf',
|
|
124
124
|
},
|
|
125
125
|
ensUniversalResolver: {
|
|
126
|
-
address: '
|
|
126
|
+
address: '0xBaBC7678D7A63104f1658c11D6AE9A21cdA09725',
|
|
127
127
|
},
|
|
128
128
|
},
|
|
129
129
|
} as const satisfies Record<
|
|
@@ -46,92 +46,128 @@ export const universalResolverErrors = [
|
|
|
46
46
|
},
|
|
47
47
|
] as const
|
|
48
48
|
|
|
49
|
+
const universalResolverReverse = {
|
|
50
|
+
inputs: [
|
|
51
|
+
{
|
|
52
|
+
name: 'reverseName',
|
|
53
|
+
type: 'bytes',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
name: 'reverse',
|
|
57
|
+
outputs: [
|
|
58
|
+
{ type: 'string', name: 'resolvedName' },
|
|
59
|
+
{ type: 'address', name: 'resolvedAddress' },
|
|
60
|
+
{ type: 'address', name: 'reverseResolver' },
|
|
61
|
+
{ type: 'address', name: 'resolver' },
|
|
62
|
+
],
|
|
63
|
+
stateMutability: 'view',
|
|
64
|
+
type: 'function',
|
|
65
|
+
} as const
|
|
66
|
+
|
|
49
67
|
export const universalResolverReverseSnippet = [
|
|
50
68
|
...universalResolverErrors,
|
|
69
|
+
universalResolverReverse,
|
|
51
70
|
{
|
|
71
|
+
...universalResolverReverse,
|
|
52
72
|
inputs: [
|
|
73
|
+
...universalResolverReverse.inputs,
|
|
53
74
|
{
|
|
54
|
-
name: '
|
|
55
|
-
type: '
|
|
75
|
+
name: 'gateways',
|
|
76
|
+
type: 'string[]',
|
|
56
77
|
},
|
|
57
78
|
],
|
|
58
|
-
name: 'reverse',
|
|
59
|
-
outputs: [
|
|
60
|
-
{ type: 'string', name: 'resolvedName' },
|
|
61
|
-
{ type: 'address', name: 'resolvedAddress' },
|
|
62
|
-
{ type: 'address', name: 'reverseResolver' },
|
|
63
|
-
{ type: 'address', name: 'resolver' },
|
|
64
|
-
],
|
|
65
|
-
stateMutability: 'view',
|
|
66
|
-
type: 'function',
|
|
67
79
|
},
|
|
68
80
|
] as const
|
|
69
81
|
|
|
82
|
+
const universalResolverResolve = {
|
|
83
|
+
inputs: [
|
|
84
|
+
{
|
|
85
|
+
name: 'name',
|
|
86
|
+
type: 'bytes',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'data',
|
|
90
|
+
type: 'bytes',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
name: 'resolve',
|
|
94
|
+
outputs: [
|
|
95
|
+
{
|
|
96
|
+
name: 'data',
|
|
97
|
+
type: 'bytes',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'resolver',
|
|
101
|
+
type: 'address',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
stateMutability: 'view',
|
|
105
|
+
type: 'function',
|
|
106
|
+
} as const
|
|
107
|
+
|
|
70
108
|
export const universalResolverResolveSnippet = [
|
|
71
109
|
...universalResolverErrors,
|
|
110
|
+
universalResolverResolve,
|
|
72
111
|
{
|
|
112
|
+
...universalResolverResolve,
|
|
73
113
|
inputs: [
|
|
114
|
+
...universalResolverResolve.inputs,
|
|
74
115
|
{
|
|
75
|
-
name: '
|
|
76
|
-
type: '
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
name: 'data',
|
|
80
|
-
type: 'bytes',
|
|
116
|
+
name: 'gateways',
|
|
117
|
+
type: 'string[]',
|
|
81
118
|
},
|
|
82
119
|
],
|
|
83
|
-
name: 'resolve',
|
|
84
|
-
outputs: [
|
|
85
|
-
{
|
|
86
|
-
name: 'data',
|
|
87
|
-
type: 'bytes',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: 'resolver',
|
|
91
|
-
type: 'address',
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
stateMutability: 'view',
|
|
95
|
-
type: 'function',
|
|
96
120
|
},
|
|
97
121
|
] as const
|
|
98
122
|
|
|
123
|
+
const universalResolverResolveArray = {
|
|
124
|
+
inputs: [
|
|
125
|
+
{
|
|
126
|
+
name: 'name',
|
|
127
|
+
type: 'bytes',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'data',
|
|
131
|
+
type: 'bytes[]',
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
name: 'resolve',
|
|
135
|
+
outputs: [
|
|
136
|
+
{
|
|
137
|
+
components: [
|
|
138
|
+
{
|
|
139
|
+
name: 'success',
|
|
140
|
+
type: 'bool',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: 'returnData',
|
|
144
|
+
type: 'bytes',
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
name: '',
|
|
148
|
+
type: 'tuple[]',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: '',
|
|
152
|
+
type: 'address',
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
stateMutability: 'view',
|
|
156
|
+
type: 'function',
|
|
157
|
+
} as const
|
|
158
|
+
|
|
99
159
|
export const universalResolverResolveArraySnippet = [
|
|
100
160
|
...universalResolverErrors,
|
|
161
|
+
universalResolverResolveArray,
|
|
101
162
|
{
|
|
163
|
+
...universalResolverResolveArray,
|
|
102
164
|
inputs: [
|
|
165
|
+
...universalResolverResolveArray.inputs,
|
|
103
166
|
{
|
|
104
|
-
name: '
|
|
105
|
-
type: '
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: 'data',
|
|
109
|
-
type: 'bytes[]',
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
name: 'resolve',
|
|
113
|
-
outputs: [
|
|
114
|
-
{
|
|
115
|
-
components: [
|
|
116
|
-
{
|
|
117
|
-
name: 'success',
|
|
118
|
-
type: 'bool',
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
name: 'returnData',
|
|
122
|
-
type: 'bytes',
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
name: '',
|
|
126
|
-
type: 'tuple[]',
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
name: '',
|
|
130
|
-
type: 'address',
|
|
167
|
+
name: 'gateways',
|
|
168
|
+
type: 'string[]',
|
|
131
169
|
},
|
|
132
170
|
],
|
|
133
|
-
stateMutability: 'view',
|
|
134
|
-
type: 'function',
|
|
135
171
|
},
|
|
136
172
|
] as const
|
|
137
173
|
|
package/src/errors/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = 'v3.
|
|
1
|
+
export const version = 'v3.1.0'
|