@ryanrfox/sdk 0.0.2 → 2.0.4
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/README.md +145 -29
- package/package.json +84 -8
- package/src/_esm/actions/index.d.ts +8 -0
- package/src/_esm/actions/index.d.ts.map +1 -0
- package/src/_esm/actions/index.js +8 -0
- package/src/_esm/actions/index.js.map +1 -0
- package/src/_esm/actions/sendTransactionBatch.d.ts +77 -0
- package/src/_esm/actions/sendTransactionBatch.d.ts.map +1 -0
- package/src/_esm/actions/sendTransactionBatch.js +245 -0
- package/src/_esm/actions/sendTransactionBatch.js.map +1 -0
- package/src/_esm/chains/chainConfig.d.ts +30 -0
- package/src/_esm/chains/chainConfig.d.ts.map +1 -0
- package/src/_esm/chains/chainConfig.js +30 -0
- package/src/_esm/chains/chainConfig.js.map +1 -0
- package/src/_esm/chains/index.d.ts +4 -0
- package/src/_esm/chains/index.d.ts.map +1 -0
- package/src/_esm/chains/index.js +4 -0
- package/src/_esm/chains/index.js.map +1 -0
- package/src/_esm/chains/radius.d.ts +64 -0
- package/src/_esm/chains/radius.d.ts.map +1 -0
- package/src/_esm/chains/radius.js +39 -0
- package/src/_esm/chains/radius.js.map +1 -0
- package/src/_esm/chains/radiusTestnet.d.ts +61 -0
- package/src/_esm/chains/radiusTestnet.d.ts.map +1 -0
- package/src/_esm/chains/radiusTestnet.js +45 -0
- package/src/_esm/chains/radiusTestnet.js.map +1 -0
- package/src/_esm/decorators/index.d.ts +8 -0
- package/src/_esm/decorators/index.d.ts.map +1 -0
- package/src/_esm/decorators/index.js +8 -0
- package/src/_esm/decorators/index.js.map +1 -0
- package/src/_esm/decorators/radius.d.ts +66 -0
- package/src/_esm/decorators/radius.d.ts.map +1 -0
- package/src/_esm/decorators/radius.js +36 -0
- package/src/_esm/decorators/radius.js.map +1 -0
- package/src/_esm/errors/account.d.ts +78 -0
- package/src/_esm/errors/account.d.ts.map +1 -0
- package/src/_esm/errors/account.js +97 -0
- package/src/_esm/errors/account.js.map +1 -0
- package/src/_esm/errors/base.d.ts +56 -0
- package/src/_esm/errors/base.d.ts.map +1 -0
- package/src/_esm/errors/base.js +51 -0
- package/src/_esm/errors/base.js.map +1 -0
- package/src/_esm/errors/contract.d.ts +51 -0
- package/src/_esm/errors/contract.d.ts.map +1 -0
- package/src/_esm/errors/contract.js +65 -0
- package/src/_esm/errors/contract.js.map +1 -0
- package/src/_esm/errors/index.d.ts +63 -0
- package/src/_esm/errors/index.d.ts.map +1 -0
- package/src/_esm/errors/index.js +40 -0
- package/src/_esm/errors/index.js.map +1 -0
- package/src/_esm/errors/transaction.d.ts +132 -0
- package/src/_esm/errors/transaction.d.ts.map +1 -0
- package/src/_esm/errors/transaction.js +143 -0
- package/src/_esm/errors/transaction.js.map +1 -0
- package/src/_esm/events/decodeEventLogs.d.ts +136 -0
- package/src/_esm/events/decodeEventLogs.d.ts.map +1 -0
- package/src/_esm/events/decodeEventLogs.js +93 -0
- package/src/_esm/events/decodeEventLogs.js.map +1 -0
- package/src/_esm/events/getLogs.d.ts +137 -0
- package/src/_esm/events/getLogs.d.ts.map +1 -0
- package/src/_esm/events/getLogs.js +171 -0
- package/src/_esm/events/getLogs.js.map +1 -0
- package/src/_esm/events/index.d.ts +17 -0
- package/src/_esm/events/index.d.ts.map +1 -0
- package/src/_esm/events/index.js +24 -0
- package/src/_esm/events/index.js.map +1 -0
- package/src/_esm/events/watchApproval.d.ts +184 -0
- package/src/_esm/events/watchApproval.d.ts.map +1 -0
- package/src/_esm/events/watchApproval.js +254 -0
- package/src/_esm/events/watchApproval.js.map +1 -0
- package/src/_esm/events/watchBlock.d.ts +192 -0
- package/src/_esm/events/watchBlock.d.ts.map +1 -0
- package/src/_esm/events/watchBlock.js +162 -0
- package/src/_esm/events/watchBlock.js.map +1 -0
- package/src/_esm/events/watchLogs.d.ts +128 -0
- package/src/_esm/events/watchLogs.d.ts.map +1 -0
- package/src/_esm/events/watchLogs.js +100 -0
- package/src/_esm/events/watchLogs.js.map +1 -0
- package/src/_esm/events/watchTransfer.d.ts +164 -0
- package/src/_esm/events/watchTransfer.d.ts.map +1 -0
- package/src/_esm/events/watchTransfer.js +234 -0
- package/src/_esm/events/watchTransfer.js.map +1 -0
- package/src/_esm/index.d.ts +16 -0
- package/src/_esm/index.d.ts.map +1 -0
- package/src/_esm/index.js +22 -0
- package/src/_esm/index.js.map +1 -0
- package/src/_esm/package.json +1 -0
- package/src/_esm/transport/index.d.ts +9 -0
- package/src/_esm/transport/index.d.ts.map +1 -0
- package/src/_esm/transport/index.js +9 -0
- package/src/_esm/transport/index.js.map +1 -0
- package/src/_esm/transport/interceptor.d.ts +48 -0
- package/src/_esm/transport/interceptor.d.ts.map +1 -0
- package/src/_esm/transport/interceptor.js +209 -0
- package/src/_esm/transport/interceptor.js.map +1 -0
- package/src/_esm/transport/types.d.ts +29 -0
- package/src/_esm/transport/types.d.ts.map +1 -0
- package/src/_esm/transport/types.js +2 -0
- package/src/_esm/transport/types.js.map +1 -0
- package/src/_esm/transport/websocket.d.ts +51 -0
- package/src/_esm/transport/websocket.d.ts.map +1 -0
- package/src/_esm/transport/websocket.js +70 -0
- package/src/_esm/transport/websocket.js.map +1 -0
- package/src/_types/actions/index.d.ts +8 -0
- package/src/_types/actions/index.d.ts.map +1 -0
- package/src/_types/actions/sendTransactionBatch.d.ts +77 -0
- package/src/_types/actions/sendTransactionBatch.d.ts.map +1 -0
- package/src/_types/chains/chainConfig.d.ts +30 -0
- package/src/_types/chains/chainConfig.d.ts.map +1 -0
- package/src/_types/chains/index.d.ts +4 -0
- package/src/_types/chains/index.d.ts.map +1 -0
- package/src/_types/chains/radius.d.ts +64 -0
- package/src/_types/chains/radius.d.ts.map +1 -0
- package/src/_types/chains/radiusTestnet.d.ts +61 -0
- package/src/_types/chains/radiusTestnet.d.ts.map +1 -0
- package/src/_types/decorators/index.d.ts +8 -0
- package/src/_types/decorators/index.d.ts.map +1 -0
- package/src/_types/decorators/radius.d.ts +66 -0
- package/src/_types/decorators/radius.d.ts.map +1 -0
- package/src/_types/errors/account.d.ts +78 -0
- package/src/_types/errors/account.d.ts.map +1 -0
- package/src/_types/errors/base.d.ts +56 -0
- package/src/_types/errors/base.d.ts.map +1 -0
- package/src/_types/errors/contract.d.ts +51 -0
- package/src/_types/errors/contract.d.ts.map +1 -0
- package/src/_types/errors/index.d.ts +63 -0
- package/src/_types/errors/index.d.ts.map +1 -0
- package/src/_types/errors/transaction.d.ts +132 -0
- package/src/_types/errors/transaction.d.ts.map +1 -0
- package/src/_types/events/decodeEventLogs.d.ts +136 -0
- package/src/_types/events/decodeEventLogs.d.ts.map +1 -0
- package/src/_types/events/getLogs.d.ts +137 -0
- package/src/_types/events/getLogs.d.ts.map +1 -0
- package/src/_types/events/index.d.ts +17 -0
- package/src/_types/events/index.d.ts.map +1 -0
- package/src/_types/events/watchApproval.d.ts +184 -0
- package/src/_types/events/watchApproval.d.ts.map +1 -0
- package/src/_types/events/watchBlock.d.ts +192 -0
- package/src/_types/events/watchBlock.d.ts.map +1 -0
- package/src/_types/events/watchLogs.d.ts +128 -0
- package/src/_types/events/watchLogs.d.ts.map +1 -0
- package/src/_types/events/watchTransfer.d.ts +164 -0
- package/src/_types/events/watchTransfer.d.ts.map +1 -0
- package/src/_types/index.d.ts +16 -0
- package/src/_types/index.d.ts.map +1 -0
- package/src/_types/transport/index.d.ts +9 -0
- package/src/_types/transport/index.d.ts.map +1 -0
- package/src/_types/transport/interceptor.d.ts +48 -0
- package/src/_types/transport/interceptor.d.ts.map +1 -0
- package/src/_types/transport/types.d.ts +29 -0
- package/src/_types/transport/types.d.ts.map +1 -0
- package/src/_types/transport/websocket.d.ts +51 -0
- package/src/_types/transport/websocket.d.ts.map +1 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared chain configuration constants for Radius.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Maximum gas limit for transactions on Radius.
|
|
6
|
+
*
|
|
7
|
+
* IMPORTANT: This constant is required because:
|
|
8
|
+
* - Radius returns gasLimit: 0 for all blocks (intentionally)
|
|
9
|
+
* - This differs from Ethereum where block.gasLimit is ~30,000,000
|
|
10
|
+
* - Dynamic fetching from blocks is not possible
|
|
11
|
+
*
|
|
12
|
+
* This value (0x13333333332) is a Radius protocol constant used to:
|
|
13
|
+
* 1. Cap gas estimates to prevent unexpectedly high values
|
|
14
|
+
* 2. Provide a safety bound for transaction gas limits
|
|
15
|
+
*
|
|
16
|
+
* Similar to how Arbitrum and zkSync SDKs use custom gas handling
|
|
17
|
+
* rather than relying on block.gasLimit.
|
|
18
|
+
*
|
|
19
|
+
* @see _research/sdk-walkthrough/GASLIMIT-ECOSYSTEM.md for full ecosystem impact analysis
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* import { MAX_GAS } from '@radiustechsystems/sdk';
|
|
24
|
+
*
|
|
25
|
+
* // Cap gas estimate at MAX_GAS
|
|
26
|
+
* const cappedGas = estimatedGas > MAX_GAS ? MAX_GAS : estimatedGas;
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare const MAX_GAS = 1319413953330n;
|
|
30
|
+
//# sourceMappingURL=chainConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chainConfig.d.ts","sourceRoot":"","sources":["../../chains/chainConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,OAAO,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared chain configuration constants for Radius.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Maximum gas limit for transactions on Radius.
|
|
6
|
+
*
|
|
7
|
+
* IMPORTANT: This constant is required because:
|
|
8
|
+
* - Radius returns gasLimit: 0 for all blocks (intentionally)
|
|
9
|
+
* - This differs from Ethereum where block.gasLimit is ~30,000,000
|
|
10
|
+
* - Dynamic fetching from blocks is not possible
|
|
11
|
+
*
|
|
12
|
+
* This value (0x13333333332) is a Radius protocol constant used to:
|
|
13
|
+
* 1. Cap gas estimates to prevent unexpectedly high values
|
|
14
|
+
* 2. Provide a safety bound for transaction gas limits
|
|
15
|
+
*
|
|
16
|
+
* Similar to how Arbitrum and zkSync SDKs use custom gas handling
|
|
17
|
+
* rather than relying on block.gasLimit.
|
|
18
|
+
*
|
|
19
|
+
* @see _research/sdk-walkthrough/GASLIMIT-ECOSYSTEM.md for full ecosystem impact analysis
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* import { MAX_GAS } from '@radiustechsystems/sdk';
|
|
24
|
+
*
|
|
25
|
+
* // Cap gas estimate at MAX_GAS
|
|
26
|
+
* const cappedGas = estimatedGas > MAX_GAS ? MAX_GAS : estimatedGas;
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export const MAX_GAS = 1319413953330n;
|
|
30
|
+
//# sourceMappingURL=chainConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chainConfig.js","sourceRoot":"","sources":["../../chains/chainConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../chains/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../chains/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Radius Mainnet chain configuration.
|
|
3
|
+
*
|
|
4
|
+
* Chain ID: 723
|
|
5
|
+
* RPC: https://rpc.radiustech.xyz
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { radius } from '@radiustechsystems/sdk/chains';
|
|
10
|
+
*
|
|
11
|
+
* const client = createPublicClient({
|
|
12
|
+
* chain: radius,
|
|
13
|
+
* transport: http(),
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const radius: {
|
|
18
|
+
blockExplorers: {
|
|
19
|
+
readonly default: {
|
|
20
|
+
readonly name: "Radius Explorer";
|
|
21
|
+
readonly url: "https://explorer.radiustech.xyz";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
blockTime?: number | undefined | undefined;
|
|
25
|
+
contracts?: {
|
|
26
|
+
[x: string]: import("viem").ChainContract | {
|
|
27
|
+
[sourceId: number]: import("viem").ChainContract | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
ensRegistry?: import("viem").ChainContract | undefined;
|
|
30
|
+
ensUniversalResolver?: import("viem").ChainContract | undefined;
|
|
31
|
+
multicall3?: import("viem").ChainContract | undefined;
|
|
32
|
+
erc6492Verifier?: import("viem").ChainContract | undefined;
|
|
33
|
+
} | undefined;
|
|
34
|
+
ensTlds?: readonly string[] | undefined;
|
|
35
|
+
id: 723;
|
|
36
|
+
name: "Radius";
|
|
37
|
+
nativeCurrency: {
|
|
38
|
+
readonly decimals: 18;
|
|
39
|
+
readonly name: "USD";
|
|
40
|
+
readonly symbol: "USD";
|
|
41
|
+
};
|
|
42
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
43
|
+
rpcUrls: {
|
|
44
|
+
readonly default: {
|
|
45
|
+
readonly http: readonly ["https://rpc.radiustech.xyz"];
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
sourceId?: number | undefined | undefined;
|
|
49
|
+
testnet: false;
|
|
50
|
+
custom?: Record<string, unknown> | undefined;
|
|
51
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
52
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
53
|
+
formatters?: undefined;
|
|
54
|
+
prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
|
|
55
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
56
|
+
}) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
|
|
57
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
58
|
+
}) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
|
|
59
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
60
|
+
}] | undefined;
|
|
61
|
+
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
62
|
+
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=radius.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radius.d.ts","sourceRoot":"","sources":["../../chains/radius.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBjB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineChain } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Radius Mainnet chain configuration.
|
|
4
|
+
*
|
|
5
|
+
* Chain ID: 723
|
|
6
|
+
* RPC: https://rpc.radiustech.xyz
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { radius } from '@radiustechsystems/sdk/chains';
|
|
11
|
+
*
|
|
12
|
+
* const client = createPublicClient({
|
|
13
|
+
* chain: radius,
|
|
14
|
+
* transport: http(),
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export const radius = /*#__PURE__*/ defineChain({
|
|
19
|
+
id: 723,
|
|
20
|
+
name: 'Radius',
|
|
21
|
+
nativeCurrency: {
|
|
22
|
+
decimals: 18,
|
|
23
|
+
name: 'USD',
|
|
24
|
+
symbol: 'USD',
|
|
25
|
+
},
|
|
26
|
+
rpcUrls: {
|
|
27
|
+
default: {
|
|
28
|
+
http: ['https://rpc.radiustech.xyz'],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
blockExplorers: {
|
|
32
|
+
default: {
|
|
33
|
+
name: 'Radius Explorer',
|
|
34
|
+
url: 'https://explorer.radiustech.xyz',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
testnet: false,
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=radius.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radius.js","sourceRoot":"","sources":["../../chains/radius.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEnC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC,WAAW,CAAC;IAC/C,EAAE,EAAE,GAAG;IACP,IAAI,EAAE,QAAQ;IACd,cAAc,EAAE;QACf,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,KAAK;KACb;IACD,OAAO,EAAE;QACR,OAAO,EAAE;YACR,IAAI,EAAE,CAAC,4BAA4B,CAAC;SACpC;KACD;IACD,cAAc,EAAE;QACf,OAAO,EAAE;YACR,IAAI,EAAE,iBAAiB;YACvB,GAAG,EAAE,iCAAiC;SACtC;KACD;IACD,OAAO,EAAE,KAAK;CACd,CAAC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Radius Testnet chain configuration.
|
|
3
|
+
*
|
|
4
|
+
* Chain ID: 1223953 (0x12ad11)
|
|
5
|
+
* RPC: https://rpc.testnet.radiustech.xyz
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { radiusTestnet } from '@radiustechsystems/sdk/chains';
|
|
10
|
+
*
|
|
11
|
+
* const client = createPublicClient({
|
|
12
|
+
* chain: radiusTestnet,
|
|
13
|
+
* transport: http(),
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const radiusTestnet: {
|
|
18
|
+
blockExplorers: {
|
|
19
|
+
readonly default: {
|
|
20
|
+
readonly name: "Radius Explorer";
|
|
21
|
+
readonly url: "https://explorer.testnet.radiustech.xyz";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
blockTime?: number | undefined | undefined;
|
|
25
|
+
contracts: {
|
|
26
|
+
readonly multicall3: {
|
|
27
|
+
readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
28
|
+
readonly blockCreated: 1768594222351;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
ensTlds?: readonly string[] | undefined;
|
|
32
|
+
id: 1223953;
|
|
33
|
+
name: "Radius Testnet";
|
|
34
|
+
nativeCurrency: {
|
|
35
|
+
readonly decimals: 18;
|
|
36
|
+
readonly name: "USD";
|
|
37
|
+
readonly symbol: "USD";
|
|
38
|
+
};
|
|
39
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
40
|
+
rpcUrls: {
|
|
41
|
+
readonly default: {
|
|
42
|
+
readonly http: readonly ["https://rpc.testnet.radiustech.xyz"];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
sourceId?: number | undefined | undefined;
|
|
46
|
+
testnet: true;
|
|
47
|
+
custom?: Record<string, unknown> | undefined;
|
|
48
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
49
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
50
|
+
formatters?: undefined;
|
|
51
|
+
prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
|
|
52
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
53
|
+
}) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
|
|
54
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
55
|
+
}) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
|
|
56
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
57
|
+
}] | undefined;
|
|
58
|
+
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
59
|
+
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=radiusTestnet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radiusTestnet.d.ts","sourceRoot":"","sources":["../../chains/radiusTestnet.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BxB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineChain } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Radius Testnet chain configuration.
|
|
4
|
+
*
|
|
5
|
+
* Chain ID: 1223953 (0x12ad11)
|
|
6
|
+
* RPC: https://rpc.testnet.radiustech.xyz
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { radiusTestnet } from '@radiustechsystems/sdk/chains';
|
|
11
|
+
*
|
|
12
|
+
* const client = createPublicClient({
|
|
13
|
+
* chain: radiusTestnet,
|
|
14
|
+
* transport: http(),
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export const radiusTestnet = /*#__PURE__*/ defineChain({
|
|
19
|
+
id: 1223953,
|
|
20
|
+
name: 'Radius Testnet',
|
|
21
|
+
nativeCurrency: {
|
|
22
|
+
decimals: 18,
|
|
23
|
+
name: 'USD',
|
|
24
|
+
symbol: 'USD',
|
|
25
|
+
},
|
|
26
|
+
rpcUrls: {
|
|
27
|
+
default: {
|
|
28
|
+
http: ['https://rpc.testnet.radiustech.xyz'],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
blockExplorers: {
|
|
32
|
+
default: {
|
|
33
|
+
name: 'Radius Explorer',
|
|
34
|
+
url: 'https://explorer.testnet.radiustech.xyz',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
contracts: {
|
|
38
|
+
multicall3: {
|
|
39
|
+
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
40
|
+
blockCreated: 1768594222351,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
testnet: true,
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=radiusTestnet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radiusTestnet.js","sourceRoot":"","sources":["../../chains/radiusTestnet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEnC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC,WAAW,CAAC;IACtD,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,gBAAgB;IACtB,cAAc,EAAE;QACf,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,KAAK;KACb;IACD,OAAO,EAAE;QACR,OAAO,EAAE;YACR,IAAI,EAAE,CAAC,oCAAoC,CAAC;SAC5C;KACD;IACD,cAAc,EAAE;QACf,OAAO,EAAE;YACR,IAAI,EAAE,iBAAiB;YACvB,GAAG,EAAE,yCAAyC;SAC9C;KACD;IACD,SAAS,EAAE;QACV,UAAU,EAAE;YACX,OAAO,EAAE,4CAA4C;YACrD,YAAY,EAAE,aAAa;SAC3B;KACD;IACD,OAAO,EAAE,IAAI;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Radius SDK Decorators
|
|
3
|
+
*
|
|
4
|
+
* Client decorators that extend viem clients with Radius-specific functionality.
|
|
5
|
+
* Follows viem's decorator pattern for composition.
|
|
6
|
+
*/
|
|
7
|
+
export { type RadiusWalletActions, radiusWalletActions } from './radius.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../decorators/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../decorators/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAA4B,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Radius wallet actions decorator.
|
|
3
|
+
*
|
|
4
|
+
* Extends viem wallet clients with Radius-specific functionality.
|
|
5
|
+
* Follows viem's decorator pattern (see: viem/src/zksync/decorators/walletL2.ts)
|
|
6
|
+
*/
|
|
7
|
+
import type { Account, Chain, Client, Transport } from 'viem';
|
|
8
|
+
import { type SendTransactionBatchParameters, type SendTransactionBatchReturnType } from '../actions/sendTransactionBatch.js';
|
|
9
|
+
/**
|
|
10
|
+
* Radius-specific wallet actions added by the radiusWalletActions decorator.
|
|
11
|
+
*/
|
|
12
|
+
export type RadiusWalletActions<_chain extends Chain | undefined = Chain | undefined, _account extends Account | undefined = Account | undefined> = {
|
|
13
|
+
/**
|
|
14
|
+
* Send multiple transactions in a single JSON-RPC batch request.
|
|
15
|
+
* Transactions are automatically assigned sequential nonces and sent atomically.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Radius does not queue future-nonce transactions like Ethereum.
|
|
19
|
+
* This method ensures all transactions arrive in nonce order by using JSON-RPC batching.
|
|
20
|
+
*
|
|
21
|
+
* @param params - The batch transaction parameters
|
|
22
|
+
* @returns Array of transaction hashes in the same order as input
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const hashes = await client.sendTransactionBatch({
|
|
27
|
+
* transactions: [
|
|
28
|
+
* { to: '0x...', value: 1000000000000000000n },
|
|
29
|
+
* { to: '0x...', data: '0x...' },
|
|
30
|
+
* ],
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
sendTransactionBatch: (params: SendTransactionBatchParameters) => Promise<SendTransactionBatchReturnType>;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Decorator that extends a viem wallet client with Radius-specific actions.
|
|
38
|
+
*
|
|
39
|
+
* @returns A decorator function that adds Radius wallet actions to a client
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* import { createWalletClient, http } from 'viem';
|
|
44
|
+
* import { privateKeyToAccount } from 'viem/accounts';
|
|
45
|
+
* import { radiusTestnet, radiusWalletActions } from '@radiustechsystems/sdk';
|
|
46
|
+
*
|
|
47
|
+
* const client = createWalletClient({
|
|
48
|
+
* account: privateKeyToAccount('0x...'),
|
|
49
|
+
* chain: radiusTestnet,
|
|
50
|
+
* transport: http(),
|
|
51
|
+
* }).extend(radiusWalletActions());
|
|
52
|
+
*
|
|
53
|
+
* // Standard viem for simple operations
|
|
54
|
+
* const hash = await client.sendTransaction({ to, value });
|
|
55
|
+
*
|
|
56
|
+
* // Radius-specific for batching
|
|
57
|
+
* const hashes = await client.sendTransactionBatch({
|
|
58
|
+
* transactions: [
|
|
59
|
+
* { to: addr1, value: 1n },
|
|
60
|
+
* { to: addr2, value: 2n },
|
|
61
|
+
* ],
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare function radiusWalletActions(): <transport extends Transport, chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined>(client: Client<transport, chain, account>) => RadiusWalletActions<chain, account>;
|
|
66
|
+
//# sourceMappingURL=radius.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radius.d.ts","sourceRoot":"","sources":["../../decorators/radius.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC9D,OAAO,EACN,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EAEnC,MAAM,oCAAoC,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAC9B,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,IACvD;IACH;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,oBAAoB,EAAE,CACrB,MAAM,EAAE,8BAA8B,KAClC,OAAO,CAAC,8BAA8B,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,mBAAmB,KAEjC,SAAS,SAAS,SAAS,EAC3B,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,OAAO,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,EAEzD,QAAQ,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,KACvC,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CAGtC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { sendTransactionBatch, } from '../actions/sendTransactionBatch.js';
|
|
2
|
+
/**
|
|
3
|
+
* Decorator that extends a viem wallet client with Radius-specific actions.
|
|
4
|
+
*
|
|
5
|
+
* @returns A decorator function that adds Radius wallet actions to a client
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { createWalletClient, http } from 'viem';
|
|
10
|
+
* import { privateKeyToAccount } from 'viem/accounts';
|
|
11
|
+
* import { radiusTestnet, radiusWalletActions } from '@radiustechsystems/sdk';
|
|
12
|
+
*
|
|
13
|
+
* const client = createWalletClient({
|
|
14
|
+
* account: privateKeyToAccount('0x...'),
|
|
15
|
+
* chain: radiusTestnet,
|
|
16
|
+
* transport: http(),
|
|
17
|
+
* }).extend(radiusWalletActions());
|
|
18
|
+
*
|
|
19
|
+
* // Standard viem for simple operations
|
|
20
|
+
* const hash = await client.sendTransaction({ to, value });
|
|
21
|
+
*
|
|
22
|
+
* // Radius-specific for batching
|
|
23
|
+
* const hashes = await client.sendTransactionBatch({
|
|
24
|
+
* transactions: [
|
|
25
|
+
* { to: addr1, value: 1n },
|
|
26
|
+
* { to: addr2, value: 2n },
|
|
27
|
+
* ],
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export function radiusWalletActions() {
|
|
32
|
+
return (client) => ({
|
|
33
|
+
sendTransactionBatch: (params) => sendTransactionBatch(client, params),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=radius.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radius.js","sourceRoot":"","sources":["../../decorators/radius.ts"],"names":[],"mappings":"AAOA,OAAO,EAGN,oBAAoB,GACpB,MAAM,oCAAoC,CAAC;AAmC5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,mBAAmB;IAClC,OAAO,CAKN,MAAyC,EACH,EAAE,CAAC,CAAC;QAC1C,oBAAoB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC;KACtE,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account and signer-related errors
|
|
3
|
+
*/
|
|
4
|
+
import type { Address } from 'viem';
|
|
5
|
+
import { RadiusError, type RadiusErrorOptions } from './base';
|
|
6
|
+
/**
|
|
7
|
+
* Error thrown when a signer is required but not available.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* try {
|
|
12
|
+
* // Attempting to send without an account configured
|
|
13
|
+
* await walletClient.sendTransaction({ to, value });
|
|
14
|
+
* } catch (error) {
|
|
15
|
+
* if (error instanceof SignerNotFoundError) {
|
|
16
|
+
* console.log('Please connect a wallet');
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class SignerNotFoundError extends RadiusError {
|
|
22
|
+
readonly name = "SignerNotFoundError";
|
|
23
|
+
constructor(message?: string, options?: RadiusErrorOptions);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Error thrown when account balance is insufficient for an operation.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* try {
|
|
31
|
+
* await walletClient.sendTransaction({ to, value });
|
|
32
|
+
* } catch (error) {
|
|
33
|
+
* if (error instanceof InsufficientBalanceError) {
|
|
34
|
+
* console.log(`Need ${error.required}, have ${error.balance}`);
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare class InsufficientBalanceError extends RadiusError {
|
|
40
|
+
readonly name = "InsufficientBalanceError";
|
|
41
|
+
/** The account address */
|
|
42
|
+
readonly address?: Address;
|
|
43
|
+
/** Current balance (in wei) */
|
|
44
|
+
readonly balance?: bigint;
|
|
45
|
+
/** Required balance (in wei) */
|
|
46
|
+
readonly required?: bigint;
|
|
47
|
+
constructor(message: string, options?: RadiusErrorOptions & {
|
|
48
|
+
address?: Address;
|
|
49
|
+
balance?: bigint;
|
|
50
|
+
required?: bigint;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Error thrown when signing a message or transaction fails.
|
|
55
|
+
*/
|
|
56
|
+
export declare class SigningError extends RadiusError {
|
|
57
|
+
readonly name = "SigningError";
|
|
58
|
+
constructor(message: string, options?: RadiusErrorOptions);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Error thrown when an invalid private key is provided.
|
|
62
|
+
*/
|
|
63
|
+
export declare class InvalidPrivateKeyError extends RadiusError {
|
|
64
|
+
readonly name = "InvalidPrivateKeyError";
|
|
65
|
+
constructor(message?: string, options?: RadiusErrorOptions);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Error thrown when address validation fails.
|
|
69
|
+
*/
|
|
70
|
+
export declare class InvalidAddressError extends RadiusError {
|
|
71
|
+
readonly name = "InvalidAddressError";
|
|
72
|
+
/** The invalid address value */
|
|
73
|
+
readonly invalidAddress?: string;
|
|
74
|
+
constructor(message: string, options?: RadiusErrorOptions & {
|
|
75
|
+
invalidAddress?: string;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
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,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;gBAGhC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,kBAAkB,GAAG;QAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;KACnB;CAQP"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { RadiusError } from './base';
|
|
2
|
+
/**
|
|
3
|
+
* Error thrown when a signer is required but not available.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* try {
|
|
8
|
+
* // Attempting to send without an account configured
|
|
9
|
+
* await walletClient.sendTransaction({ to, value });
|
|
10
|
+
* } catch (error) {
|
|
11
|
+
* if (error instanceof SignerNotFoundError) {
|
|
12
|
+
* console.log('Please connect a wallet');
|
|
13
|
+
* }
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export class SignerNotFoundError extends RadiusError {
|
|
18
|
+
name = 'SignerNotFoundError';
|
|
19
|
+
constructor(message = 'Signer is required', options = {}) {
|
|
20
|
+
super(message, {
|
|
21
|
+
...options,
|
|
22
|
+
docsPath: options.docsPath ?? '/docs/sdk/errors#signer-not-found',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Error thrown when account balance is insufficient for an operation.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* try {
|
|
32
|
+
* await walletClient.sendTransaction({ to, value });
|
|
33
|
+
* } catch (error) {
|
|
34
|
+
* if (error instanceof InsufficientBalanceError) {
|
|
35
|
+
* console.log(`Need ${error.required}, have ${error.balance}`);
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export class InsufficientBalanceError extends RadiusError {
|
|
41
|
+
name = 'InsufficientBalanceError';
|
|
42
|
+
/** The account address */
|
|
43
|
+
address;
|
|
44
|
+
/** Current balance (in wei) */
|
|
45
|
+
balance;
|
|
46
|
+
/** Required balance (in wei) */
|
|
47
|
+
required;
|
|
48
|
+
constructor(message, options = {}) {
|
|
49
|
+
super(message, {
|
|
50
|
+
...options,
|
|
51
|
+
docsPath: options.docsPath ?? '/docs/sdk/errors#insufficient-balance',
|
|
52
|
+
});
|
|
53
|
+
this.address = options.address;
|
|
54
|
+
this.balance = options.balance;
|
|
55
|
+
this.required = options.required;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Error thrown when signing a message or transaction fails.
|
|
60
|
+
*/
|
|
61
|
+
export class SigningError extends RadiusError {
|
|
62
|
+
name = 'SigningError';
|
|
63
|
+
constructor(message, options = {}) {
|
|
64
|
+
super(message, {
|
|
65
|
+
...options,
|
|
66
|
+
docsPath: options.docsPath ?? '/docs/sdk/errors#signing',
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Error thrown when an invalid private key is provided.
|
|
72
|
+
*/
|
|
73
|
+
export class InvalidPrivateKeyError extends RadiusError {
|
|
74
|
+
name = 'InvalidPrivateKeyError';
|
|
75
|
+
constructor(message = 'Invalid private key', options = {}) {
|
|
76
|
+
super(message, {
|
|
77
|
+
...options,
|
|
78
|
+
docsPath: options.docsPath ?? '/docs/sdk/errors#invalid-private-key',
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Error thrown when address validation fails.
|
|
84
|
+
*/
|
|
85
|
+
export class InvalidAddressError extends RadiusError {
|
|
86
|
+
name = 'InvalidAddressError';
|
|
87
|
+
/** The invalid address value */
|
|
88
|
+
invalidAddress;
|
|
89
|
+
constructor(message, options = {}) {
|
|
90
|
+
super(message, {
|
|
91
|
+
...options,
|
|
92
|
+
docsPath: options.docsPath ?? '/docs/sdk/errors#invalid-address',
|
|
93
|
+
});
|
|
94
|
+
this.invalidAddress = options.invalidAddress;
|
|
95
|
+
}
|
|
96
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