@hashgraph/hedera-wallet-connect 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/browser-cjs-metafile.json +1 -1
- package/dist/browser-cjs.js +1 -1
- package/dist/browser-esm-metafile.json +1 -1
- package/dist/browser-esm.js +1 -1
- package/dist/node-cjs-metafile.json +1 -1
- package/dist/node-cjs.js +5 -4
- package/dist/node-esm-metafile.json +1 -1
- package/dist/node-esm.js +5 -4
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/lib/dapp/DAppSigner.d.ts +29 -0
- package/dist/types/src/lib/dapp/DAppSigner.d.ts.map +1 -0
- package/dist/types/src/lib/dapp/index.d.ts +177 -0
- package/dist/types/src/lib/dapp/index.d.ts.map +1 -0
- package/dist/types/src/lib/index.d.ts +4 -0
- package/dist/types/src/lib/index.d.ts.map +1 -0
- package/dist/types/src/lib/shared/chainIds.d.ts +12 -0
- package/dist/types/src/lib/shared/chainIds.d.ts.map +1 -0
- package/dist/types/src/lib/shared/errors.d.ts +49 -0
- package/dist/types/src/lib/shared/errors.d.ts.map +1 -0
- package/dist/types/src/lib/shared/events.d.ts +8 -0
- package/dist/types/src/lib/shared/events.d.ts.map +1 -0
- package/dist/types/src/lib/shared/index.d.ts +7 -0
- package/dist/types/src/lib/shared/index.d.ts.map +1 -0
- package/dist/types/src/lib/shared/methods.d.ts +13 -0
- package/dist/types/src/lib/shared/methods.d.ts.map +1 -0
- package/dist/types/src/lib/shared/payloads.d.ts +102 -0
- package/dist/types/src/lib/shared/payloads.d.ts.map +1 -0
- package/dist/types/src/lib/shared/utils.d.ts +269 -0
- package/dist/types/src/lib/shared/utils.d.ts.map +1 -0
- package/dist/types/src/lib/wallet/index.d.ts +40 -0
- package/dist/types/src/lib/wallet/index.d.ts.map +1 -0
- package/dist/types/src/lib/wallet/provider.d.ts +18 -0
- package/dist/types/src/lib/wallet/provider.d.ts.map +1 -0
- package/dist/types/src/lib/wallet/types.d.ts +32 -0
- package/dist/types/src/lib/wallet/types.d.ts.map +1 -0
- package/dist/types/test/_helpers.d.ts +35 -0
- package/dist/types/test/_helpers.d.ts.map +1 -0
- package/dist/types/test/dapp/DAppConnector.test.d.ts +2 -0
- package/dist/types/test/dapp/DAppConnector.test.d.ts.map +1 -0
- package/dist/types/test/utils.test.d.ts +2 -0
- package/dist/types/test/utils.test.d.ts.map +1 -0
- package/dist/types/test/wallet/methods/wallet-executeTransaction.test.d.ts +2 -0
- package/dist/types/test/wallet/methods/wallet-executeTransaction.test.d.ts.map +1 -0
- package/dist/types/test/wallet/methods/wallet-getNodeAddresses.test.d.ts +2 -0
- package/dist/types/test/wallet/methods/wallet-getNodeAddresses.test.d.ts.map +1 -0
- package/dist/types/test/wallet/methods/wallet-signAndExecuteQuery.test.d.ts +2 -0
- package/dist/types/test/wallet/methods/wallet-signAndExecuteQuery.test.d.ts.map +1 -0
- package/dist/types/test/wallet/methods/wallet-signAndExecuteTransaction.test.d.ts +2 -0
- package/dist/types/test/wallet/methods/wallet-signAndExecuteTransaction.test.d.ts.map +1 -0
- package/dist/types/test/wallet/methods/wallet-signMessage.test.d.ts +2 -0
- package/dist/types/test/wallet/methods/wallet-signMessage.test.d.ts.map +1 -0
- package/dist/types/test/wallet/methods/wallet-signTransaction.test.d.ts +2 -0
- package/dist/types/test/wallet/methods/wallet-signTransaction.test.d.ts.map +1 -0
- package/dist/types/test/wallet/wallet-init.test.d.ts +2 -0
- package/dist/types/test/wallet/wallet-init.test.d.ts.map +1 -0
- package/package.json +3 -3
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -35
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -17
- package/.github/ISSUE_TEMPLATE/hip_820.md +0 -16
- package/.github/dependabot.yml +0 -17
- package/.github/workflows/prettier.yml +0 -28
- package/.github/workflows/publish.yml +0 -35
- package/.github/workflows/test.yml +0 -32
- package/.husky/pre-commit +0 -4
- package/.lintstagedrc.json +0 -5
- package/.prettierignore +0 -3
- package/jest.config.ts +0 -33
- package/scripts/examples/build.mjs +0 -54
- package/scripts/examples/dev.mjs +0 -54
- package/scripts/lib/build.mjs +0 -40
- package/scripts/lib/context.mjs +0 -71
- package/scripts/lib/watch.mjs +0 -28
- package/typedoc.json +0 -10
@@ -0,0 +1,269 @@
|
|
1
|
+
import { AccountId, PublicKey, Transaction, LedgerId, Query, SignerSignature } from '@hashgraph/sdk';
|
2
|
+
import { ProposalTypes, SessionTypes } from '@walletconnect/types';
|
3
|
+
import { proto } from '@hashgraph/proto';
|
4
|
+
/**
|
5
|
+
* Freezes a transaction if it is not already frozen. Transactions must
|
6
|
+
* be frozen before they can be converted to bytes.
|
7
|
+
*
|
8
|
+
* @param transaction - Any instance of a class that extends `Transaction`
|
9
|
+
*/
|
10
|
+
export declare function freezeTransaction<T extends Transaction>(transaction: T): void;
|
11
|
+
/**
|
12
|
+
* Sets default consensus nodes that a transaction will be submitted to. Node Account ID(s)
|
13
|
+
* must be set before a transaction can be frozen. If they have already been set, this
|
14
|
+
* function will not modify the transaction.
|
15
|
+
* @param transaction - any instance of a class that extends `Transaction`
|
16
|
+
*
|
17
|
+
* @see {@link https://docs.hedera.com/hedera/networks/testnet/testnet-nodes | Full list of Testnet-nodes}
|
18
|
+
* @see {@link https://docs.hedera.com/hedera/networks/mainnet/mainnet-nodes | Full list of Mainnet-nodes}
|
19
|
+
*/
|
20
|
+
export declare function setDefaultNodeAccountIds<T extends Transaction>(transaction: T): void;
|
21
|
+
/**
|
22
|
+
* Converts `Transaction` to a Base64-string.
|
23
|
+
*
|
24
|
+
* First converts a transaction to bytes and then encodes it as a Base64-string. Will attempt
|
25
|
+
* to set default Node Account ID and freeze the transaction before converting.
|
26
|
+
* @param transaction - Any instance of a class that extends `Transaction`
|
27
|
+
* @returns Base64 encoded representation of the input `Transaction` object
|
28
|
+
*/
|
29
|
+
export declare function transactionToBase64String<T extends Transaction>(transaction: T): string;
|
30
|
+
/**
|
31
|
+
* Recreates a `Transaction` from a base64 encoded string.
|
32
|
+
*
|
33
|
+
* Decodes the string to a buffer,
|
34
|
+
* then passes to `Transaction.fromBytes`. For greater flexibility, this function uses the base
|
35
|
+
* `Transaction` class, but takes an optional type parameter if the type of transaction is known,
|
36
|
+
* allowing stronger typeing.
|
37
|
+
* @param transactionBytes - a base64 encoded string
|
38
|
+
* @returns `Transaction`
|
39
|
+
* @example
|
40
|
+
* ```ts
|
41
|
+
* const txn1 = base64StringToTransaction(bytesString)
|
42
|
+
* const txn2 = base64StringToTransaction<TransferTransaction>(bytesString)
|
43
|
+
* // txn1 type: Transaction
|
44
|
+
* // txn2 type: TransferTransaction
|
45
|
+
* ```
|
46
|
+
*/
|
47
|
+
export declare function base64StringToTransaction<T extends Transaction>(transactionBytes: string): T;
|
48
|
+
/**
|
49
|
+
* @param transaction - a base64 encoded string of proto.TransactionBody.encode().finish()
|
50
|
+
* @returns `string`
|
51
|
+
* */
|
52
|
+
export declare function transactionToTransactionBody<T extends Transaction>(transaction: T, nodeAccountId: AccountId): any;
|
53
|
+
export declare function transactionBodyToBase64String(transactionBody: proto.TransactionBody): string;
|
54
|
+
/**
|
55
|
+
* @param transactionList - a proto.TransactionList object
|
56
|
+
* @returns `string`
|
57
|
+
* */
|
58
|
+
export declare function transactionListToBase64String(transactionList: proto.TransactionList): string;
|
59
|
+
/**
|
60
|
+
* Decodes base64 encoded proto.TransactionBody bytes to a `proto.TransactionBody` object.
|
61
|
+
*
|
62
|
+
* @param transactionBody - a base64 encoded string of proto.TransactionBody.encode().finish()
|
63
|
+
* @returns `Transaction`
|
64
|
+
*
|
65
|
+
* */
|
66
|
+
export declare function base64StringToTransactionBody(transactionBody: string): proto.TransactionBody;
|
67
|
+
/**
|
68
|
+
* Converts a `proto.SignatureMap` to a base64 encoded string.
|
69
|
+
*
|
70
|
+
* First converts the `proto.SignatureMap` object to a JSON.
|
71
|
+
* Then encodes the JSON to a base64 encoded string.
|
72
|
+
* @param signatureMap - The `proto.SignatureMap` object to be converted
|
73
|
+
* @returns Base64-encoded string representation of the input `proto.SignatureMap`
|
74
|
+
*/
|
75
|
+
export declare function signatureMapToBase64String(signatureMap: proto.SignatureMap): string;
|
76
|
+
/**
|
77
|
+
* Converts a Base64-encoded string to a `proto.SignatureMap`.
|
78
|
+
* @param base64string - Base64-encoded string
|
79
|
+
* @returns `proto.SignatureMap`
|
80
|
+
*/
|
81
|
+
export declare function base64StringToSignatureMap(base64string: string): proto.SignatureMap;
|
82
|
+
/**
|
83
|
+
* Encodes the binary data represented by the `Uint8Array` to a Base64 string.
|
84
|
+
* @param binary - The `Uint8Array` containing binary data to be converted
|
85
|
+
* @returns Base64-encoded string representation of the input `Uint8Array`
|
86
|
+
*/
|
87
|
+
export declare function Uint8ArrayToBase64String(binary: Uint8Array): string;
|
88
|
+
/**
|
89
|
+
* Converts a Base64-encoded string to a `Uint8Array`.
|
90
|
+
* @param base64string - Base64-encoded string to be converted
|
91
|
+
* @returns A `Uint8Array` representing the decoded binary data
|
92
|
+
*/
|
93
|
+
export declare function base64StringToUint8Array(base64string: string): Uint8Array;
|
94
|
+
/**
|
95
|
+
* Converts a `Query` object to a Base64-encoded string.
|
96
|
+
* First utilizes the `toBytes` method of the `Query` instance to obtain its binary `Uint8Array` representation.
|
97
|
+
* Then encodes the binary `Uint8Array` to a Base64 string representation.
|
98
|
+
* @param query - A `Query` object to be converted
|
99
|
+
* @returns Base64 encoded representation of the input `Query` object
|
100
|
+
*/
|
101
|
+
export declare function queryToBase64String<T, Q extends Query<T>>(query: Q): string;
|
102
|
+
/**
|
103
|
+
* Recreates a `Query` from a Base64-encoded string. First decodes the string to a buffer,
|
104
|
+
* then passes to `Query.fromBytes`. For greater flexibility, this function uses the base
|
105
|
+
* `Query` class, but takes an optional type parameter if the type of query is known,
|
106
|
+
* allowing stronger typeing.
|
107
|
+
* @param bytesString - Base64-encoded string
|
108
|
+
* @returns `Query<T>`
|
109
|
+
* @example
|
110
|
+
* ```ts
|
111
|
+
* const query1 = base64StringToQuery(bytesString)
|
112
|
+
* const query2 = base64StringToQuery<AccountInfoQuery>(bytesString)
|
113
|
+
* // query1 type: Query<any>
|
114
|
+
* // query2 type: AccountInfoQuery
|
115
|
+
* ```
|
116
|
+
*/
|
117
|
+
export declare function base64StringToQuery<Q extends Query<any>>(bytesString: string): Q;
|
118
|
+
export declare function prefixMessageToSign(message: string): string;
|
119
|
+
/**
|
120
|
+
* Incorporates additional data (salt) into the message to alter the output signature.
|
121
|
+
* This alteration ensures that passing a transaction here for signing will yield an invalid signature,
|
122
|
+
* as the additional data modifies the signature text.
|
123
|
+
*
|
124
|
+
* @param message - A plain text string
|
125
|
+
* @returns An array of Uint8Array containing the prepared message for signing
|
126
|
+
*/
|
127
|
+
export declare function stringToSignerMessage(message: string): Uint8Array[];
|
128
|
+
/**
|
129
|
+
* This implementation expects a plain text string, which is prefixed and then signed by a wallet.
|
130
|
+
* Because the spec calls for 1 message to be signed and 1 signer, this function expects a single
|
131
|
+
* signature and used the first item in the sigPair array.
|
132
|
+
*
|
133
|
+
* @param message - A plain text string
|
134
|
+
* @param base64SignatureMap - A base64 encoded proto.SignatureMap object
|
135
|
+
* @returns boolean - whether or not the first signature in the sigPair is valid for the message and public key
|
136
|
+
*/
|
137
|
+
export declare function verifyMessageSignature(message: string, base64SignatureMap: string, publicKey: PublicKey): boolean;
|
138
|
+
/**
|
139
|
+
*
|
140
|
+
* https://github.com/hashgraph/hedera-sdk-js/blob/c78512b1d43eedf1d8bf2926a5b7ed3368fc39d1/src/PublicKey.js#L258
|
141
|
+
* a signature pair is a protobuf object with a signature and a public key, it is the responsibility of a dApp to ensure the public key matches the account id
|
142
|
+
* @param signerSignatures - An array of `SignerSignature` objects
|
143
|
+
* @returns `proto.SignatureMap` object
|
144
|
+
*/
|
145
|
+
export declare function signerSignaturesToSignatureMap(signerSignatures: SignerSignature[]): proto.SignatureMap;
|
146
|
+
/**
|
147
|
+
* A mapping of `LedgerId` to EIP chain id and CAIP-2 network name.
|
148
|
+
*
|
149
|
+
* Structure: [`LedgerId`, `number` (EIP155 chain id), `string` (CAIP-2 chain id)][]
|
150
|
+
*
|
151
|
+
* @see {@link https://namespaces.chainagnostic.org/hedera/README | Hedera Namespaces}
|
152
|
+
* @see {@link https://hips.hedera.com/hip/hip-30 | CAIP Identifiers for the Hedera Network (HIP-30)}
|
153
|
+
*/
|
154
|
+
export declare const LEDGER_ID_MAPPINGS: [LedgerId, number, string][];
|
155
|
+
/**
|
156
|
+
* Converts an EIP chain id to a LedgerId object.
|
157
|
+
*
|
158
|
+
* If no mapping is found, returns `LedgerId.LOCAL_NODE`.
|
159
|
+
*
|
160
|
+
* @param chainId - The EIP chain ID (number) to be converted
|
161
|
+
* @returns A `LedgerId` corresponding to the provided chain ID
|
162
|
+
* @example
|
163
|
+
* ```ts
|
164
|
+
* const localnodeLedgerId = EIPChainIdToLedgerId(298)
|
165
|
+
* console.log(localnodeLedgerId) // LedgerId.LOCAL_NODE
|
166
|
+
* const mainnetLedgerId = EIPChainIdToLedgerId(295)
|
167
|
+
* console.log(mainnetLedgerId) // LedgerId.MAINNET
|
168
|
+
* ```
|
169
|
+
*/
|
170
|
+
export declare function EIPChainIdToLedgerId(chainId: number): LedgerId;
|
171
|
+
/**
|
172
|
+
* Converts a LedgerId object to an EIP chain id.
|
173
|
+
*
|
174
|
+
* If no mapping is found, returns the EIP chain id for `LedgerId.LOCAL_NODE`.
|
175
|
+
*
|
176
|
+
* @param ledgerId - The `LedgerId` object to be converted
|
177
|
+
* @returns A `number` representing the EIP chain id for the provided `LedgerId`
|
178
|
+
* @example
|
179
|
+
* ```ts
|
180
|
+
* const previewnetChainId = ledgerIdToEIPChainId(LedgerId.PREVIEWNET)
|
181
|
+
* console.log(previewnetChainId) // 297
|
182
|
+
* const testnetChainId = ledgerIdToEIPChainId(LedgerId.TESTNET)
|
183
|
+
* console.log(testnetChainId) // 296
|
184
|
+
* ```
|
185
|
+
*/
|
186
|
+
export declare function ledgerIdToEIPChainId(ledgerId: LedgerId): number;
|
187
|
+
/**
|
188
|
+
* Converts a network name to an EIP chain id.
|
189
|
+
* If no mapping is found, returns the EIP chain id for `LedgerId.LOCAL_NODE`.
|
190
|
+
*
|
191
|
+
* @param networkName - The network name (string) to be converted
|
192
|
+
* @returns A `number` representing the EIP chain id for the provided network name
|
193
|
+
* @example
|
194
|
+
* ```ts
|
195
|
+
* const mainnetChainId = networkNameToEIPChainId('mainnet')
|
196
|
+
* console.log(mainnetChainId) // 295
|
197
|
+
* const testnetChainId = networkNameToEIPChainId('testnet')
|
198
|
+
* console.log(mainnetChainId) // 296
|
199
|
+
* ```
|
200
|
+
*/
|
201
|
+
export declare function networkNameToEIPChainId(networkName: string): number;
|
202
|
+
/**
|
203
|
+
* Converts a CAIP chain id to a LedgerId object.
|
204
|
+
*
|
205
|
+
* If no mapping is found, returns `LedgerId.LOCAL_NODE`.
|
206
|
+
*
|
207
|
+
* @param chainId - The CAIP chain ID (string) to be converted
|
208
|
+
* @returns A `LedgerId` corresponding to the provided CAIP chain ID
|
209
|
+
* @example
|
210
|
+
* ```ts
|
211
|
+
* const previewnetLedgerId = CAIPChainIdToLedgerId(HederaChainId.Previewnet)
|
212
|
+
* console.log(previewnetLedgerId) // LedgerId.PREVIEWNET
|
213
|
+
* const testnetLedgerId = CAIPChainIdToLedgerId(HederaChainId.Testnet)
|
214
|
+
* console.log(testnetLedgerId) // LedgerId.TESTNET
|
215
|
+
* ```
|
216
|
+
*/
|
217
|
+
export declare function CAIPChainIdToLedgerId(chainId: string): LedgerId;
|
218
|
+
/**
|
219
|
+
* Converts a LedgerId object to a CAIP chain id.
|
220
|
+
*
|
221
|
+
* If no mapping is found, returns the CAIP chain id for `LedgerId.LOCAL_NODE`.
|
222
|
+
*
|
223
|
+
* @param ledgerId - The `LedgerId` object to be converted
|
224
|
+
* @returns A `string` representing the CAIP chain id for the provided `LedgerId`
|
225
|
+
* @example
|
226
|
+
* ```ts
|
227
|
+
* const mainnetChainId = ledgerIdToCAIPChainId(HederaChainId.Mainnet)
|
228
|
+
* console.log(mainnetChainId) // LedgerId.PREVIEWNET
|
229
|
+
* const testnetChainId = ledgerIdToCAIPChainId(HederaChainId.Testnet)
|
230
|
+
* console.log(testnetChainId) // LedgerId.TESTNET
|
231
|
+
* ```
|
232
|
+
*/
|
233
|
+
export declare function ledgerIdToCAIPChainId(ledgerId: LedgerId): string;
|
234
|
+
/**
|
235
|
+
* Converts a network name to a CAIP chain id.
|
236
|
+
*
|
237
|
+
* If no mapping is found, returns the CAIP chain id for `LedgerId.LOCAL_NODE`.
|
238
|
+
*
|
239
|
+
* @param networkName - The network name (string) to be converted
|
240
|
+
* @returns A `string` representing the CAIP chain id for the provided network name
|
241
|
+
* @example
|
242
|
+
* ```ts
|
243
|
+
* const previewnetChainId = networkNameToCAIPChainId('previewnet')
|
244
|
+
* console.log(previewnetChainId) // HederaChainId.Previewnet
|
245
|
+
* const devnetChainId = networkNameToCAIPChainId('devnet')
|
246
|
+
* console.log(devnetChainId) // HederaChainId.Devnet
|
247
|
+
* ```
|
248
|
+
*/
|
249
|
+
export declare function networkNameToCAIPChainId(networkName: string): string;
|
250
|
+
/**
|
251
|
+
* Create a `ProposalTypes.RequiredNamespaces` object for a given ledgerId.
|
252
|
+
*
|
253
|
+
* @param ledgerId - The `LedgerId` for which the namespaces are created
|
254
|
+
* @param methods - An array of strings representing methods
|
255
|
+
* @param events - An array of strings representing events
|
256
|
+
* @returns A `ProposalTypes.RequiredNamespaces` object
|
257
|
+
*/
|
258
|
+
export declare const networkNamespaces: (ledgerId: LedgerId, methods: string[], events: string[]) => ProposalTypes.RequiredNamespaces;
|
259
|
+
/**
|
260
|
+
* Get the account and ledger from a `SessionTypes.Struct` object.
|
261
|
+
*
|
262
|
+
* @param session - The `SessionTypes.Struct` object containing namespaces
|
263
|
+
* @returns `ProposalTypes.RequiredNamespaces` - an array of objects containing network (LedgerId) and account (AccountId)
|
264
|
+
*/
|
265
|
+
export declare const accountAndLedgerFromSession: (session: SessionTypes.Struct) => {
|
266
|
+
network: LedgerId;
|
267
|
+
account: AccountId;
|
268
|
+
}[];
|
269
|
+
//# sourceMappingURL=utils.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/lib/shared/utils.ts"],"names":[],"mappings":"AAqBA,OAAO,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,KAAK,EACL,eAAe,EAChB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAExC;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,EAAE,WAAW,EAAE,CAAC,GAAG,IAAI,CAE7E;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,WAAW,EAAE,WAAW,EAAE,CAAC,GAAG,IAAI,CAMpF;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,WAAW,EAAE,WAAW,EAAE,CAAC,GAAG,MAAM,CAKvF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,WAAW,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC,CAG5F;AAED;;;KAGK;AACL,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,WAAW,EAChE,WAAW,EAAE,CAAC,EACd,aAAa,EAAE,SAAS,OAKzB;AAED,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,KAAK,CAAC,eAAe,UAEnF;AAED;;;KAGK;AACL,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,KAAK,CAAC,eAAe,UAGnF;AAED;;;;;;KAMK;AAEL,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,MAAM,GAAG,KAAK,CAAC,eAAe,CAG5F;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,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G,MAAM,CAQ/D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAGnE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAQ/D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAQhE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAIpE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,aAClB,QAAQ,WACT,MAAM,EAAE,UACT,MAAM,EAAE,KACf,cAAc,kBAMf,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,YAC7B,aAAa,MAAM,KAC3B;IAAE,OAAO,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,SAAS,CAAA;CAAE,EAW3C,CAAA"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { Web3Wallet, Web3WalletTypes } from '@walletconnect/web3wallet';
|
2
|
+
import { SessionTypes } from '@walletconnect/types';
|
3
|
+
import { Wallet as HederaWallet, AccountId, Transaction, Query } from '@hashgraph/sdk';
|
4
|
+
import { HederaChainId, HederaSessionEvent, HederaJsonRpcMethod } from '../shared';
|
5
|
+
import Provider from './provider';
|
6
|
+
import type { HederaNativeWallet } from './types';
|
7
|
+
export type { HederaNativeWallet } from './types';
|
8
|
+
export { default as WalletProvider } from './provider';
|
9
|
+
export declare class HederaWeb3Wallet extends Web3Wallet implements HederaNativeWallet {
|
10
|
+
chains: HederaChainId[] | string[];
|
11
|
+
methods: string[];
|
12
|
+
sessionEvents: HederaSessionEvent[] | string[];
|
13
|
+
constructor(opts: Web3WalletTypes.Options, chains?: HederaChainId[] | string[], methods?: string[], sessionEvents?: HederaSessionEvent[] | string[]);
|
14
|
+
static create(projectId: string, metadata: Web3WalletTypes.Metadata, chains?: HederaChainId[], methods?: string[], sessionEvents?: HederaSessionEvent[] | string[]): Promise<HederaWeb3Wallet>;
|
15
|
+
getHederaWallet(chainId: HederaChainId, accountId: AccountId | string, privateKey: string, _provider?: Provider): HederaWallet;
|
16
|
+
buildAndApproveSession(accounts: string[], { id, params }: Web3WalletTypes.SessionProposal): Promise<SessionTypes.Struct>;
|
17
|
+
validateParam(name: string, value: any, expectedType: string): void;
|
18
|
+
parseSessionRequest(event: Web3WalletTypes.SessionRequest, shouldThrow?: boolean): {
|
19
|
+
method: HederaJsonRpcMethod;
|
20
|
+
chainId: HederaChainId;
|
21
|
+
id: number;
|
22
|
+
topic: string;
|
23
|
+
body?: Transaction | Query<any> | string | Uint8Array | undefined;
|
24
|
+
accountId?: AccountId;
|
25
|
+
};
|
26
|
+
executeSessionRequest(event: Web3WalletTypes.SessionRequest, hederaWallet: HederaWallet): Promise<void>;
|
27
|
+
rejectSessionRequest(event: Web3WalletTypes.SessionRequest, error: {
|
28
|
+
code: number;
|
29
|
+
message: string;
|
30
|
+
}): Promise<void>;
|
31
|
+
hedera_getNodeAddresses(id: number, topic: string, _: any, // ignore this param to be consistent call signature with other functions
|
32
|
+
signer: HederaWallet): Promise<void>;
|
33
|
+
hedera_executeTransaction(id: number, topic: string, body: Transaction, signer: HederaWallet): Promise<void>;
|
34
|
+
hedera_signMessage(id: number, topic: string, body: string, signer: HederaWallet): Promise<void>;
|
35
|
+
hedera_signAndExecuteQuery(id: number, topic: string, body: Query<any>, signer: HederaWallet): Promise<void>;
|
36
|
+
hedera_signAndExecuteTransaction(id: number, topic: string, body: Transaction, signer: HederaWallet): Promise<void>;
|
37
|
+
hedera_signTransaction(id: number, topic: string, body: Uint8Array, signer: HederaWallet): Promise<void>;
|
38
|
+
}
|
39
|
+
export default HederaWeb3Wallet;
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"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,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC;IAwBH,0BAA0B,CACrC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,EAChB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC;IAwBH,gCAAgC,CAC3C,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC;IAgBH,sBAAsB,CACjC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC;CAsBjB;AAED,eAAe,gBAAgB,CAAA"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { Client, type AccountId, type Executable, type Provider as HederaWalletProvider, type TransactionId, type TransactionResponse, type TransactionReceipt } from '@hashgraph/sdk';
|
2
|
+
export default class Provider implements HederaWalletProvider {
|
3
|
+
private client;
|
4
|
+
constructor(client: Client);
|
5
|
+
static fromClient(client: Client): Provider;
|
6
|
+
getLedgerId(): import("@hashgraph/sdk/lib/LedgerId").default | null;
|
7
|
+
getNetwork(): {
|
8
|
+
[key: string]: string | AccountId;
|
9
|
+
};
|
10
|
+
getMirrorNetwork(): string[];
|
11
|
+
getAccountBalance(accountId: AccountId | string): Promise<import("@hashgraph/sdk").AccountBalance>;
|
12
|
+
getAccountInfo(accountId: AccountId | string): Promise<import("@hashgraph/sdk").AccountInfo>;
|
13
|
+
getAccountRecords(accountId: string | AccountId): Promise<import("@hashgraph/sdk").TransactionRecord[]>;
|
14
|
+
getTransactionReceipt(transactionId: TransactionId | string): Promise<TransactionReceipt>;
|
15
|
+
waitForReceipt(response: TransactionResponse): Promise<TransactionReceipt>;
|
16
|
+
call<Request, Response, Output>(request: Executable<Request, Response, Output>): Promise<Output>;
|
17
|
+
}
|
18
|
+
//# sourceMappingURL=provider.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../../src/lib/wallet/provider.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,MAAM,EAKN,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,QAAQ,IAAI,oBAAoB,EACrC,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAA;AAEvB,MAAM,CAAC,OAAO,OAAO,QAAS,YAAW,oBAAoB;IAC/C,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAElC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM;IAIhC,WAAW;IAIX,UAAU;;;IAIV,gBAAgB;IAIhB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM;IAI/C,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM;IAI5C,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS;IAI/C,qBAAqB,CAAC,aAAa,EAAE,aAAa,GAAG,MAAM;IAI3D,cAAc,CAAC,QAAQ,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAO1E,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAC5B,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,GAC7C,OAAO,CAAC,MAAM,CAAC;CAGnB"}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import type { Web3WalletTypes } from '@walletconnect/web3wallet';
|
2
|
+
import type { SessionTypes } from '@walletconnect/types';
|
3
|
+
import type { Transaction, Query, AccountId, Wallet as HederaWallet } from '@hashgraph/sdk';
|
4
|
+
import type { HederaJsonRpcMethod, HederaChainId } from '../shared';
|
5
|
+
import type Provider from './provider';
|
6
|
+
export interface HederaNativeWallet {
|
7
|
+
buildAndApproveSession(accounts: string[], { id, params }: Web3WalletTypes.SessionProposal): Promise<SessionTypes.Struct>;
|
8
|
+
parseSessionRequest(event: Web3WalletTypes.SessionRequest, shouldThrow: boolean): {
|
9
|
+
method: HederaJsonRpcMethod;
|
10
|
+
chainId: HederaChainId;
|
11
|
+
id: number;
|
12
|
+
topic: string;
|
13
|
+
body?: Transaction | Query<any> | string | Uint8Array | undefined;
|
14
|
+
accountId?: AccountId;
|
15
|
+
};
|
16
|
+
executeSessionRequest(event: Web3WalletTypes.SessionRequest, hederaWallet: HederaWallet): Promise<void>;
|
17
|
+
rejectSessionRequest(event: Web3WalletTypes.SessionRequest, error: {
|
18
|
+
code: number;
|
19
|
+
message: string;
|
20
|
+
}): Promise<void>;
|
21
|
+
getHederaWallet(chainId: HederaChainId, accountId: AccountId | string, privateKey: string, _provider?: Provider): HederaWallet;
|
22
|
+
[HederaJsonRpcMethod.GetNodeAddresses](id: number, topic: string, _: any, // ignore this param to be consistent call signature with other functions
|
23
|
+
signer: HederaWallet): Promise<void>;
|
24
|
+
[HederaJsonRpcMethod.ExecuteTransaction](id: number, topic: string, body: Transaction, signer: HederaWallet): Promise<void>;
|
25
|
+
[HederaJsonRpcMethod.SignMessage](id: number, topic: string, body: string, signer: HederaWallet): Promise<void>;
|
26
|
+
[HederaJsonRpcMethod.SignAndExecuteQuery](id: number, topic: string, body: Query<any>, signer: HederaWallet): Promise<void>;
|
27
|
+
[HederaJsonRpcMethod.SignAndExecuteTransaction](id: number, topic: string, body: Transaction, signer: HederaWallet): Promise<void>;
|
28
|
+
[HederaJsonRpcMethod.SignTransaction](id: number, topic: string, body: Uint8Array, signer: HederaWallet): Promise<void>;
|
29
|
+
}
|
30
|
+
export interface HederaEvmCompatibleWallet {
|
31
|
+
}
|
32
|
+
//# sourceMappingURL=types.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib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ountId, Transaction, TransactionId } from '@hashgraph/sdk';
|
2
|
+
export declare const projectId = "ce06497abf4102004138a10edd29c921";
|
3
|
+
export declare const walletMetadata: {
|
4
|
+
name: string;
|
5
|
+
url: string;
|
6
|
+
description: string;
|
7
|
+
icons: string[];
|
8
|
+
};
|
9
|
+
export declare const dAppMetadata: {
|
10
|
+
name: string;
|
11
|
+
url: string;
|
12
|
+
description: string;
|
13
|
+
icons: string[];
|
14
|
+
};
|
15
|
+
export declare const requestId = 1;
|
16
|
+
export declare const requestTopic = "test-topic";
|
17
|
+
export declare const defaultAccountNumber = 12345;
|
18
|
+
export declare const defaultNodeId = 3;
|
19
|
+
export declare const testUserAccountId: AccountId;
|
20
|
+
export declare const testNodeAccountId: AccountId;
|
21
|
+
/** Fixed to a specific timestamp */
|
22
|
+
export declare const testTransactionId: TransactionId;
|
23
|
+
type Options = {
|
24
|
+
setNodeAccountIds?: boolean;
|
25
|
+
setTransactionId?: boolean;
|
26
|
+
freeze?: boolean;
|
27
|
+
operatorAccountId?: number;
|
28
|
+
};
|
29
|
+
export declare function prepareTestTransaction<T extends Transaction = Transaction>(transaction: T, options?: Options): T;
|
30
|
+
export declare const testPrivateKeyECDSA = "3030020100300706052b8104000a042204203ce31ffad30d6db47c315bbea08232aad2266d8800a12aa3d8a812486e782759";
|
31
|
+
export declare const testPrivateKeyED25519 = "302e020100300506032b657004220420133eefea772add1f995c96bccf42b08b76daf67665f0c4c5ae308fae9275c142";
|
32
|
+
export declare function useJsonFixture(filename: string): any;
|
33
|
+
export declare function writeJsonFixture(filename: string, data: any): void;
|
34
|
+
export {};
|
35
|
+
//# sourceMappingURL=_helpers.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"_helpers.d.ts","sourceRoot":"","sources":["../../../test/_helpers.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEtE,eAAO,MAAM,SAAS,qCAAqC,CAAA;AAC3D,eAAO,MAAM,cAAc;;;;;CAO1B,CAAA;AACD,eAAO,MAAM,YAAY;;;;;CAOxB,CAAA;AACD,eAAO,MAAM,SAAS,IAAI,CAAA;AAC1B,eAAO,MAAM,YAAY,eAAe,CAAA;AACxC,eAAO,MAAM,oBAAoB,QAAQ,CAAA;AACzC,eAAO,MAAM,aAAa,IAAI,CAAA;AAC9B,eAAO,MAAM,iBAAiB,WAAsC,CAAA;AACpE,eAAO,MAAM,iBAAiB,WAA+B,CAAA;AAC7D,oCAAoC;AACpC,eAAO,MAAM,iBAAiB,eAE7B,CAAA;AAED,KAAK,OAAO,GAAG;IACb,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AACD,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EACxE,WAAW,EAAE,CAAC,EACd,OAAO,CAAC,EAAE,OAAO,GAChB,CAAC,CA2BH;AAGD,eAAO,MAAM,mBAAmB,yGACwE,CAAA;AAExG,eAAO,MAAM,qBAAqB,qGACkE,CAAA;AAUpG,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,OAI9C;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,QAG3D"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"DAppConnector.test.d.ts","sourceRoot":"","sources":["../../../../test/dapp/DAppConnector.test.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../../test/utils.test.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wallet-executeTransaction.test.d.ts","sourceRoot":"","sources":["../../../../../test/wallet/methods/wallet-executeTransaction.test.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wallet-getNodeAddresses.test.d.ts","sourceRoot":"","sources":["../../../../../test/wallet/methods/wallet-getNodeAddresses.test.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wallet-signAndExecuteQuery.test.d.ts","sourceRoot":"","sources":["../../../../../test/wallet/methods/wallet-signAndExecuteQuery.test.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wallet-signAndExecuteTransaction.test.d.ts","sourceRoot":"","sources":["../../../../../test/wallet/methods/wallet-signAndExecuteTransaction.test.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wallet-signMessage.test.d.ts","sourceRoot":"","sources":["../../../../../test/wallet/methods/wallet-signMessage.test.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wallet-signTransaction.test.d.ts","sourceRoot":"","sources":["../../../../../test/wallet/methods/wallet-signTransaction.test.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wallet-init.test.d.ts","sourceRoot":"","sources":["../../../../test/wallet/wallet-init.test.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@hashgraph/hedera-wallet-connect",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.6",
|
4
4
|
"description": "A library to facilitate integrating Hedera with WalletConnect",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -12,7 +12,7 @@
|
|
12
12
|
"./dist/node-cjs.js": "./dist/browser-cjs.js",
|
13
13
|
"./dist/node-esm.js": "./dist/browser-esm.js"
|
14
14
|
},
|
15
|
-
"types": "./dist/types/index.d.ts",
|
15
|
+
"types": "./dist/types/src/index.d.ts",
|
16
16
|
"author": "Hgraph <support@hgraph.io>",
|
17
17
|
"keywords": [
|
18
18
|
"hedera",
|
@@ -21,6 +21,7 @@
|
|
21
21
|
],
|
22
22
|
"license": "Apache-2.0",
|
23
23
|
"devDependencies": {
|
24
|
+
"@hashgraph/hedera-wallet-connect": "^1.0.5",
|
24
25
|
"@types/jest": "^29.5.3",
|
25
26
|
"@types/node": "^20.11.10",
|
26
27
|
"@walletconnect/modal": "^2.6.2",
|
@@ -45,7 +46,6 @@
|
|
45
46
|
},
|
46
47
|
"dependencies": {
|
47
48
|
"@hashgraph/sdk": "^2.40.0",
|
48
|
-
"@hashgraph/walletconnect": "file:./",
|
49
49
|
"@walletconnect/qrcode-modal": "^1.8.0",
|
50
50
|
"@walletconnect/types": "^2.11.0",
|
51
51
|
"@walletconnect/utils": "^2.11.0",
|
@@ -1,35 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Bug report
|
3
|
-
about: Create a report to help us improve
|
4
|
-
title: ''
|
5
|
-
labels: ''
|
6
|
-
assignees: ''
|
7
|
-
---
|
8
|
-
|
9
|
-
**Describe the bug** A clear and concise description of what the bug is.
|
10
|
-
|
11
|
-
**To Reproduce** Steps to reproduce the behavior:
|
12
|
-
|
13
|
-
1. Go to '...'
|
14
|
-
2. Click on '....'
|
15
|
-
3. Scroll down to '....'
|
16
|
-
4. See error
|
17
|
-
|
18
|
-
**Expected behavior** A clear and concise description of what you expected to happen.
|
19
|
-
|
20
|
-
**Screenshots** If applicable, add screenshots to help explain your problem.
|
21
|
-
|
22
|
-
**Desktop (please complete the following information):**
|
23
|
-
|
24
|
-
- OS: [e.g. iOS]
|
25
|
-
- Browser [e.g. chrome, safari]
|
26
|
-
- Version [e.g. 22]
|
27
|
-
|
28
|
-
**Smartphone (please complete the following information):**
|
29
|
-
|
30
|
-
- Device: [e.g. iPhone6]
|
31
|
-
- OS: [e.g. iOS8.1]
|
32
|
-
- Browser [e.g. stock browser, safari]
|
33
|
-
- Version [e.g. 22]
|
34
|
-
|
35
|
-
**Additional context** Add any other context about the problem here.
|
@@ -1,17 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Feature request
|
3
|
-
about: Suggest an idea for this project
|
4
|
-
title: ''
|
5
|
-
labels: ''
|
6
|
-
assignees: ''
|
7
|
-
---
|
8
|
-
|
9
|
-
**Is your feature request related to a problem? Please describe.** A clear and concise
|
10
|
-
description of what the problem is. Ex. I'm always frustrated when [...]
|
11
|
-
|
12
|
-
**Describe the solution you'd like** A clear and concise description of what you want to happen.
|
13
|
-
|
14
|
-
**Describe alternatives you've considered** A clear and concise description of any alternative
|
15
|
-
solutions or features you've considered.
|
16
|
-
|
17
|
-
**Additional context** Add any other context or screenshots about the feature request here.
|
@@ -1,16 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: HIP-820 implementation
|
3
|
-
about: Create a ticket documenting a part of HIP-820 that is not yet implemented
|
4
|
-
title: ''
|
5
|
-
labels: ''
|
6
|
-
assignees: ''
|
7
|
-
---
|
8
|
-
|
9
|
-
**Describe the spec as defined in HIP-820** A clear and concise description of what the spec
|
10
|
-
states.
|
11
|
-
|
12
|
-
**Does this issue add new functionality to this repository or change functionality (such as a
|
13
|
-
change in function signature)** Whether or not this functionality is new.
|
14
|
-
|
15
|
-
**Additional context** Add any other context about the problem here. Are there other options
|
16
|
-
that should be explored while implementing this issue?
|
package/.github/dependabot.yml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
version: 2
|
2
|
-
updates:
|
3
|
-
- package-ecosystem: "github-actions"
|
4
|
-
directory: "/"
|
5
|
-
schedule:
|
6
|
-
interval: "daily"
|
7
|
-
open-pull-requests-limit: 10
|
8
|
-
- package-ecosystem: "docker"
|
9
|
-
directory: "/"
|
10
|
-
schedule:
|
11
|
-
interval: "weekly"
|
12
|
-
open-pull-requests-limit: 10
|
13
|
-
- package-ecosystem: "npm"
|
14
|
-
directory: "/"
|
15
|
-
schedule:
|
16
|
-
interval: "weekly"
|
17
|
-
open-pull-requests-limit: 10
|