diff --git a/dist/eas.d.ts b/dist/eas.d.ts index 15e5fa3..bef85ae 100644 --- a/dist/eas.d.ts +++ b/dist/eas.d.ts @@ -4,7 +4,6 @@ import { EIP712Proxy } from './eip712-proxy'; import { Delegated, Offchain } from './offchain'; import { AttestationRequest, DelegatedAttestationRequest, DelegatedProxyAttestationRequest, DelegatedProxyRevocationRequest, DelegatedRevocationRequest, MultiAttestationRequest, MultiDelegatedAttestationRequest, MultiDelegatedProxyAttestationRequest, MultiDelegatedProxyRevocationRequest, MultiDelegatedRevocationRequest, MultiRevocationRequest, RevocationRequest } from './request'; import { Base, Transaction, TransactionSigner } from './transaction'; -export { Overrides } from 'ethers'; export * from './request'; export interface Attestation { uid: string; diff --git a/dist/eas.js b/dist/eas.js index e675332..77eccfe 100644 --- a/dist/eas.js +++ b/dist/eas.js @@ -20,6 +20,7 @@ class EAS extends transaction_1.Base { if (!this.contract.getAddress) { throw new Error('Incompatible ethers version detect. Make sure to use the SDK with ethers v6 or later'); } + this.signer = signer; if (proxy) { this.proxy = proxy; } @@ -79,13 +80,19 @@ class EAS extends transaction_1.Base { } // Attests to a specific schema async attest({ schema, data: { recipient = utils_1.ZERO_ADDRESS, data, expirationTime = request_1.NO_EXPIRATION, revocable = true, refUID = utils_1.ZERO_BYTES32, value = 0n } }, overrides) { - const tx = await this.contract.attest({ schema, data: { recipient, expirationTime, revocable, refUID, data, value } }, { value, ...overrides }); + if (!this.signer) { + throw new Error('Invalid signer'); + } + return new transaction_1.Transaction(await this.contract.attest.populateTransaction({ schema, data: { recipient, expirationTime, revocable, refUID, data, value } }, { value, ...overrides }), this.signer, // eslint-disable-next-line require-await - return new transaction_1.Transaction(tx, async (receipt) => (0, utils_1.getUIDsFromAttestReceipt)(receipt)[0]); + async (receipt) => (0, utils_1.getUIDsFromAttestReceipt)(receipt)[0]); } // Attests to a specific schema via an EIP712 delegation request async attestByDelegation({ schema, data: { recipient = utils_1.ZERO_ADDRESS, data, expirationTime = request_1.NO_EXPIRATION, revocable = true, refUID = utils_1.ZERO_BYTES32, value = 0n }, signature, attester, deadline = request_1.NO_EXPIRATION }, overrides) { - const tx = await this.contract.attestByDelegation({ + if (!this.signer) { + throw new Error('Invalid signer'); + } + return new transaction_1.Transaction(await this.contract.attestByDelegation.populateTransaction({ schema, data: { recipient, @@ -98,12 +105,15 @@ class EAS extends transaction_1.Base { signature, attester, deadline - }, { value, ...overrides }); + }, { value, ...overrides }), this.signer, // eslint-disable-next-line require-await - return new transaction_1.Transaction(tx, async (receipt) => (0, utils_1.getUIDsFromAttestReceipt)(receipt)[0]); + async (receipt) => (0, utils_1.getUIDsFromAttestReceipt)(receipt)[0]); } // Multi-attests to multiple schemas async multiAttest(requests, overrides) { + if (!this.signer) { + throw new Error('Invalid signer'); + } const multiAttestationRequests = requests.map((r) => ({ schema: r.schema, data: r.data.map((d) => ({ @@ -119,15 +129,18 @@ class EAS extends transaction_1.Base { const total = data.reduce((res, r) => res + r.value, 0n); return res + total; }, 0n); - const tx = await this.contract.multiAttest(multiAttestationRequests, { + return new transaction_1.Transaction(await this.contract.multiAttest.populateTransaction(multiAttestationRequests, { value: requestedValue, ...overrides - }); + }), this.signer, // eslint-disable-next-line require-await - return new transaction_1.Transaction(tx, async (receipt) => (0, utils_1.getUIDsFromAttestReceipt)(receipt)); + async (receipt) => (0, utils_1.getUIDsFromAttestReceipt)(receipt)); } // Multi-attests to multiple schemas via an EIP712 delegation requests async multiAttestByDelegation(requests, overrides) { + if (!this.signer) { + throw new Error('Invalid signer'); + } const multiAttestationRequests = requests.map((r) => ({ schema: r.schema, data: r.data.map((d) => ({ @@ -146,21 +159,26 @@ class EAS extends transaction_1.Base { const total = data.reduce((res, r) => res + r.value, 0n); return res + total; }, 0n); - const tx = await this.contract.multiAttestByDelegation(multiAttestationRequests, { + return new transaction_1.Transaction(await this.contract.multiAttestByDelegation.populateTransaction(multiAttestationRequests, { value: requestedValue, ...overrides - }); + }), this.signer, // eslint-disable-next-line require-await - return new transaction_1.Transaction(tx, async (receipt) => (0, utils_1.getUIDsFromAttestReceipt)(receipt)); + async (receipt) => (0, utils_1.getUIDsFromAttestReceipt)(receipt)); } // Revokes an existing attestation async revoke({ schema, data: { uid, value = 0n } }, overrides) { - const tx = await this.contract.revoke({ schema, data: { uid, value } }, { value, ...overrides }); - return new transaction_1.Transaction(tx, async () => { }); + if (!this.signer) { + throw new Error('Invalid signer'); + } + return new transaction_1.Transaction(await this.contract.revoke.populateTransaction({ schema, data: { uid, value } }, { value, ...overrides }), this.signer, async () => { }); } // Revokes an existing attestation an EIP712 delegation request async revokeByDelegation({ schema, data: { uid, value = 0n }, signature, revoker, deadline = request_1.NO_EXPIRATION }, overrides) { - const tx = await this.contract.revokeByDelegation({ + if (!this.signer) { + throw new Error('Invalid signer'); + } + return new transaction_1.Transaction(await this.contract.revokeByDelegation.populateTransaction({ schema, data: { uid, @@ -169,11 +187,13 @@ class EAS extends transaction_1.Base { signature, revoker, deadline - }, { value, ...overrides }); - return new transaction_1.Transaction(tx, async () => { }); + }, { value, ...overrides }), this.signer, async () => { }); } // Multi-revokes multiple attestations async multiRevoke(requests, overrides) { + if (!this.signer) { + throw new Error('Invalid signer'); + } const multiRevocationRequests = requests.map((r) => ({ schema: r.schema, data: r.data.map((d) => ({ @@ -185,14 +205,16 @@ class EAS extends transaction_1.Base { const total = data.reduce((res, r) => res + r.value, 0n); return res + total; }, 0n); - const tx = await this.contract.multiRevoke(multiRevocationRequests, { + return new transaction_1.Transaction(await this.contract.multiRevoke.populateTransaction(multiRevocationRequests, { value: requestedValue, ...overrides - }); - return new transaction_1.Transaction(tx, async () => { }); + }), this.signer, async () => { }); } // Multi-revokes multiple attestations via an EIP712 delegation requests async multiRevokeByDelegation(requests, overrides) { + if (!this.signer) { + throw new Error('Invalid signer'); + } const multiRevocationRequests = requests.map((r) => ({ schema: r.schema, data: r.data.map((d) => ({ @@ -207,11 +229,10 @@ class EAS extends transaction_1.Base { const total = data.reduce((res, r) => res + r.value, 0n); return res + total; }, 0n); - const tx = await this.contract.multiRevokeByDelegation(multiRevocationRequests, { + return new transaction_1.Transaction(await this.contract.multiRevokeByDelegation.populateTransaction(multiRevocationRequests, { value: requestedValue, ...overrides - }); - return new transaction_1.Transaction(tx, async () => { }); + }), this.signer, async () => { }); } // Attests to a specific schema via an EIP712 delegation request using an external EIP712 proxy attestByDelegationProxy(request, overrides) { @@ -243,28 +264,39 @@ class EAS extends transaction_1.Base { } // Timestamps the specified bytes32 data async timestamp(data, overrides) { - const tx = await this.contract.timestamp(data, overrides ?? {}); + if (!this.signer) { + throw new Error('Invalid signer'); + } + return new transaction_1.Transaction(await this.contract.timestamp.populateTransaction(data, overrides ?? {}), this.signer, // eslint-disable-next-line require-await - return new transaction_1.Transaction(tx, async (receipt) => (0, utils_1.getTimestampFromTimestampReceipt)(receipt)[0]); + async (receipt) => (0, utils_1.getTimestampFromTimestampReceipt)(receipt)[0]); } // Timestamps the specified multiple bytes32 data async multiTimestamp(data, overrides) { - const tx = await this.contract.multiTimestamp(data, overrides ?? {}); + if (!this.signer) { + throw new Error('Invalid signer'); + } + return new transaction_1.Transaction(await this.contract.multiTimestamp.populateTransaction(data, overrides ?? {}), this.signer, // eslint-disable-next-line require-await - return new transaction_1.Transaction(tx, async (receipt) => (0, utils_1.getTimestampFromTimestampReceipt)(receipt)); + async (receipt) => (0, utils_1.getTimestampFromTimestampReceipt)(receipt)); } // Revokes the specified offchain attestation UID async revokeOffchain(uid, overrides) { - const tx = await this.contract.revokeOffchain(uid, overrides ?? {}); - return new transaction_1.Transaction(tx, + if (!this.signer) { + throw new Error('Invalid signer'); + } + return new transaction_1.Transaction(await this.contract.revokeOffchain.populateTransaction(uid, overrides ?? {}), this.signer, // eslint-disable-next-line require-await async (receipt) => (0, utils_1.getTimestampFromOffchainRevocationReceipt)(receipt)[0]); } // Revokes the specified multiple offchain attestation UIDs async multiRevokeOffchain(uids, overrides) { - const tx = await this.contract.multiRevokeOffchain(uids, overrides ?? {}); + if (!this.signer) { + throw new Error('Invalid signer'); + } + return new transaction_1.Transaction(await this.contract.multiRevokeOffchain.populateTransaction(uids, overrides ?? {}), this.signer, // eslint-disable-next-line require-await - return new transaction_1.Transaction(tx, async (receipt) => (0, utils_1.getTimestampFromOffchainRevocationReceipt)(receipt)); + async (receipt) => (0, utils_1.getTimestampFromOffchainRevocationReceipt)(receipt)); } // Returns the domain separator used in the encoding of the signatures for attest, and revoke getDomainSeparator() { diff --git a/dist/eas.js.map b/dist/eas.js.map index 98e02f2..d7d3dee 100644 --- a/dist/eas.js.map +++ b/dist/eas.js.map @@ -1 +1 @@ -{"version":3,"file":"eas.js","sourceRoot":"","sources":["../src/eas.ts"],"names":[],"mappings":";;;;AAAA,+EAA+F;AAG/F,8CAAiD;AACjD,yCAA6E;AAC7E,uCAcmB;AACnB,+CAAqE;AACrE,mCAMiB;AAGjB,oDAA0B;AAoB1B,MAAa,GAAI,SAAQ,kBAAiB;IAChC,KAAK,CAAe;IACpB,SAAS,CAAa;IACtB,QAAQ,CAAY;IAE5B,YAAY,OAAe,EAAE,OAAoB;QAC/C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAExC,KAAK,CAAC,IAAI,4BAAY,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAE3C,oCAAoC;QACpC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,sFAAsF,CAAC,CAAC;QAC1G,CAAC;QAED,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,CAAC;IACH,CAAC;IAED,wCAAwC;IACjC,OAAO,CAAC,MAAyB;QACtC,OAAO,IAAI,CAAC,SAAS,CAAC;QACtB,OAAO,IAAI,CAAC,QAAQ,CAAC;QAErB,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEtB,OAAO,IAAI,CAAC;IACd,CAAC;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,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AAjfD,kBAifC"} \ No newline at end of file diff --git a/dist/eip712-proxy.js b/dist/eip712-proxy.js index c344c83..4e169bc 100644 --- a/dist/eip712-proxy.js +++ b/dist/eip712-proxy.js @@ -56,7 +56,10 @@ class EIP712Proxy extends transaction_1.Base { } // Attests to a specific schema via an EIP712 delegation request using an external EIP712 proxy async attestByDelegationProxy({ schema, data: { recipient, data, expirationTime = request_1.NO_EXPIRATION, revocable = true, refUID = utils_1.ZERO_BYTES32, value = 0n }, attester, signature, deadline = request_1.NO_EXPIRATION }, overrides) { - const tx = await this.contract.attestByDelegation({ + if (!this.signer) { + throw new Error('Invalid signer'); + } + return new transaction_1.Transaction(await this.contract.attestByDelegation.populateTransaction({ schema, data: { recipient, @@ -69,12 +72,15 @@ class EIP712Proxy extends transaction_1.Base { signature, attester, deadline - }, { value, ...overrides }); + }, { value, ...overrides }), this.signer, // eslint-disable-next-line require-await - return new transaction_1.Transaction(tx, async (receipt) => (0, utils_1.getUIDsFromAttestReceipt)(receipt)[0]); + async (receipt) => (0, utils_1.getUIDsFromAttestReceipt)(receipt)[0]); } // Multi-attests to multiple schemas via an EIP712 delegation requests using an external EIP712 proxy async multiAttestByDelegationProxy(requests, overrides) { + if (!this.signer) { + throw new Error('Invalid signer'); + } const multiAttestationRequests = requests.map((r) => ({ schema: r.schema, data: r.data.map((d) => ({ @@ -93,16 +99,19 @@ class EIP712Proxy extends transaction_1.Base { const total = data.reduce((res, r) => res + r.value, 0n); return res + total; }, 0n); - const tx = await this.contract.multiAttestByDelegation(multiAttestationRequests, { + return new transaction_1.Transaction(await this.contract.multiAttestByDelegation.populateTransaction(multiAttestationRequests, { value: requestedValue, ...overrides - }); + }), this.signer, // eslint-disable-next-line require-await - return new transaction_1.Transaction(tx, async (receipt) => (0, utils_1.getUIDsFromAttestReceipt)(receipt)); + async (receipt) => (0, utils_1.getUIDsFromAttestReceipt)(receipt)); } // Revokes an existing attestation an EIP712 delegation request using an external EIP712 proxy async revokeByDelegationProxy({ schema, data: { uid, value = 0n }, signature, revoker, deadline = request_1.NO_EXPIRATION }, overrides) { - const tx = await this.contract.revokeByDelegation({ + if (!this.signer) { + throw new Error('Invalid signer'); + } + return new transaction_1.Transaction(await this.contract.revokeByDelegation.populateTransaction({ schema, data: { uid, @@ -111,11 +120,13 @@ class EIP712Proxy extends transaction_1.Base { signature, revoker, deadline - }, { value, ...overrides }); - return new transaction_1.Transaction(tx, async () => { }); + }, { value, ...overrides }), this.signer, async () => { }); } // Multi-revokes multiple attestations via an EIP712 delegation requests using an external EIP712 proxy async multiRevokeByDelegationProxy(requests, overrides) { + if (!this.signer) { + throw new Error('Invalid signer'); + } const multiRevocationRequests = requests.map((r) => ({ schema: r.schema, data: r.data.map((d) => ({ @@ -130,11 +141,10 @@ class EIP712Proxy extends transaction_1.Base { const total = data.reduce((res, r) => res + r.value, 0n); return res + total; }, 0n); - const tx = await this.contract.multiRevokeByDelegation(multiRevocationRequests, { + return new transaction_1.Transaction(await this.contract.multiRevokeByDelegation.populateTransaction(multiRevocationRequests, { value: requestedValue, ...overrides - }); - return new transaction_1.Transaction(tx, async () => { }); + }), this.signer, async () => { }); } // Sets the delegated attestations helper async setDelegated() { diff --git a/dist/eip712-proxy.js.map b/dist/eip712-proxy.js.map index 81ed3c4..638631c 100644 --- a/dist/eip712-proxy.js.map +++ b/dist/eip712-proxy.js.map @@ -1 +1 @@ -{"version":3,"file":"eip712-proxy.js","sourceRoot":"","sources":["../src/eip712-proxy.ts"],"names":[],"mappings":";;;AAAA,+EAAuH;AAEvH,8CAAiD;AACjD,yCAA4C;AAC5C,uCAMmB;AACnB,+CAAqE;AACrE,mCAAiE;AAMjE,MAAa,WAAY,SAAQ,kBAAyB;IAChD,SAAS,CAAkB;IAEnC,YAAY,OAAe,EAAE,OAA4B;QACvD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAEjC,KAAK,CAAC,IAAI,o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ACjC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AA5ND,kCA4NC"} \ No newline at end of file diff --git a/dist/indexer.js b/dist/indexer.js index a39b37e..684e6df 100644 --- a/dist/indexer.js +++ b/dist/indexer.js @@ -26,13 +26,17 @@ class Indexer extends transaction_1.Base { } // Indexes an existing attestation async indexAttestation({ uid }, overrides) { - const tx = await this.contract.indexAttestation(uid, { ...overrides }); - return new transaction_1.Transaction(tx, async () => { }); + if (!this.signer) { + throw new Error('Invalid signer'); + } + return new transaction_1.Transaction(await this.contract.indexAttestation.populateTransaction(uid, { ...overrides }), this.signer, async () => { }); } // Indexes multiple existing attestations async indexAttestations({ uids }, overrides) { - const tx = await this.contract.indexAttestations(uids, { ...overrides }); - return new transaction_1.Transaction(tx, async () => { }); + if (!this.signer) { + throw new Error('Invalid signer'); + } + return new transaction_1.Transaction(await this.contract.indexAttestations.populateTransaction(uids, { ...overrides }), this.signer, async () => { }); } isAttestationIndexed({ uid }, overrides) { return this.contract.isAttestationIndexed(uid, { ...overrides }); diff --git a/dist/indexer.js.map b/dist/indexer.js.map index 60da4ec..024ed3b 100644 --- a/dist/indexer.js.map +++ b/dist/indexer.js.map @@ -1 +1 @@ -{"version":3,"file":"indexer.js","sourceRoot":"","sources":["../src/indexer.ts"],"names":[],"mappings":";;;AAAA,+EAA2G;AAE3G,8CAAiD;AAEjD,+CAAqE;AAsDrE,MAAa,OAAQ,SAAQ,kBAAqB;IACxC,SAAS,CAAkB;IAEnC,YAAY,OAAe,EAAE,OAAwB;QACnD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAEjC,KAAK,CAAC,IAAI,gCAAgB,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;IAED,wCAAwC;IACjC,OAAO,CAAC,MAAyB;QACtC,OAAO,IAAI,CAAC,SAAS,CAAC;QAEtB,KAAK,CAAC,OAAO,CAAC,MAAM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IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE;YACjF,GAAG,SAAS;SACb,CAAC,CAAC;IACL,CAAC;IAEM,4BAA4B,CACjC,EAAE,MAAM,EAAuC,EAC/C,SAAqB;QAErB,OAAO,IAAI,CAAC,QAAQ,CAAC,4BAA4B,CAAC,MAAM,EAAE;YACxD,GAAG,SAAS;SACb,CAAC,CAAC;IACL,CAAC;CACF;AAxID,0BAwIC"} \ No newline at end of file diff --git a/dist/schema-encoder.js.map b/dist/schema-encoder.js.map index 320251c..f560748 100644 --- a/dist/schema-encoder.js.map +++ b/dist/schema-encoder.js.map @@ -1 +1 @@ -{"version":3,"file":"schema-encoder.js","sourceRoot":"","sources":["../src/schema-encoder.ts"],"names":[],"mappings":";;;AAAA,mCAAsF;AACtF,+CAAmC;AAEnC,mCAAuC;AA2BvC,MAAM,UAAU,GAAG,OAAO,CAAC;AAC3B,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAEnC,MAAa,aAAa;IACjB,MAAM,CAA4B;IAEzC,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QAEjB,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QAC3D,MAAM,QAAQ,GAAG,yBAAgB,CAAC,IAAI,CAAC,QAAQ,WAAW,GAAG,CAAC,CAAC;QAE/D,uEAAuE;QACvE,iBAAQ,CAAC,eAAe,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAE5D,KAAK,MAAM,SAAS,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YACxC,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;YAE1C,IAAI,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;YACzB,IAAI,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IA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AC;QAC/C,CAAC;QAED,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,kBAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACnC,MAAM,OAAO,GAAG,iBAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;YAE/F,OAAO,OAAO,CAAC;QACjB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,aAAa,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,kBAAkB,CAAC,KAAa;QAC7C,IAAI,CAAC;YACH,iBAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;YACxD,OAAO,KAAK,CAAC;QACf,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,IAAA,4BAAmB,EAAC,KAAK,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAEO,UAAU;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;CACF;AAxND,sCAwNC"} \ No newline at end of file diff --git a/dist/schema-registry.js b/dist/schema-registry.js index ace586d..c8617c3 100644 --- a/dist/schema-registry.js +++ b/dist/schema-registry.js @@ -16,9 +16,12 @@ class SchemaRegistry extends transaction_1.Base { } // Registers a new schema and returns its UID async register({ schema, resolverAddress = utils_1.ZERO_ADDRESS, revocable = true }, overrides) { - const tx = await this.contract.register(schema, resolverAddress, revocable, overrides ?? {}); + if (!this.signer) { + throw new Error('Invalid signer'); + } + return new transaction_1.Transaction(await this.contract.register.populateTransaction(schema, resolverAddress, revocable, overrides ?? {}), this.signer, // eslint-disable-next-line require-await - return new transaction_1.Transaction(tx, async (_receipt) => (0, utils_1.getSchemaUID)(schema, resolverAddress, revocable)); + async (_receipt) => (0, utils_1.getSchemaUID)(schema, resolverAddress, revocable)); } // Returns an existing schema by a schema UID async getSchema({ uid }) { diff --git a/dist/schema-registry.js.map b/dist/schema-registry.js.map index 67e1328..430f07a 100644 --- a/dist/schema-registry.js.map +++ b/dist/schema-registry.js.map @@ -1 +1 @@ -{"version":3,"file":"schema-registry.js","sourceRoot":"","sources":["../src/schema-registry.ts"],"names":[],"mappings":";;;AAAA,+EAGqD;AAErD,8CAAiD;AACjD,+CAAqE;AACrE,mCAAmE;AAuBnE,MAAa,cAAe,SAAQ,kBAA4B;IAC9D,YAAY,OAAe,EAAE,OAA+B;QAC1D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAEjC,KAAK,CAAC,IAAI,uCAAuB,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;IAED,sCAAsC;IAC/B,KAAK,CAAC,UAAU;QACrB,OAAO,CAAC,MAAM,IAAA,uBAAa,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IACzE,CAAC;IAED,6CAA6C;IACtC,KAAK,CAAC,QAAQ,CACnB,EAAE,MAAM,EAAE,eAAe,GAAG,oBAAY,EAAE,SAAS,GAAG,IAAI,EAAwB,EAClF,SAAqB;QAErB,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;QAE7F,yCAAyC;QACzC,OAAO,IAAI,yBAAW,CAAC,EAAE,EAAE,KAAK,EAAE,QAA4B,EAAE,EAAE,CAChE,IAAA,oBAAY,EAAC,MAAM,EAAE,eAAe,EAAE,SAAS,CAAC,CACjD,CAAC;IACJ,CAAC;IAED,6CAA6C;IACtC,KAAK,CAAC,SAAS,CAAC,EAAE,GAAG,EAAmB;QAC7C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAClD,IAAI,MAAM,CAAC,GAAG,KAAK,oBAAY,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAlCD,wCAkCC"} \ No newline at end of file +{"version":3,"file":"schema-registry.js","sourceRoot":"","sources":["../src/schema-registry.ts"],"names":[],"mappings":";;;AAAA,+EAGqD;AAErD,8CAAiD;AACjD,+CAAqE;AACrE,mCAAmE;AAuBnE,MAAa,cAAe,SAAQ,kBAA4B;IAC9D,YAAY,OAAe,EAAE,OAA+B;QAC1D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAEjC,KAAK,CAAC,IAAI,uCAAuB,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;IAED,sCAAsC;IAC/B,KAAK,CAAC,UAAU;QACrB,OAAO,CAAC,MAAM,IAAA,uBAAa,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IACzE,CAAC;IAED,6CAA6C;IACtC,KAAK,CAAC,QAAQ,CACnB,EAAE,MAAM,EAAE,eAAe,GAAG,oBAAY,EAAE,SAAS,GAAG,IAAI,EAAwB,EAClF,SAAqB;QAErB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,IAAI,yBAAW,CACpB,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,mBAAmB,CAAC,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,IAAI,EAAE,CAAC,EACrG,IAAI,CAAC,MAAM;QACX,yCAAyC;QACzC,KAAK,EAAE,QAA4B,EAAE,EAAE,CAAC,IAAA,oBAAY,EAAC,MAAM,EAAE,eAAe,EAAE,SAAS,CAAC,CACzF,CAAC;IACJ,CAAC;IAED,6CAA6C;IACtC,KAAK,CAAC,SAAS,CAAC,EAAE,GAAG,EAAmB;QAC7C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAClD,IAAI,MAAM,CAAC,GAAG,KAAK,oBAAY,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAtCD,wCAsCC"} \ No newline at end of file diff --git a/dist/transaction.d.ts b/dist/transaction.d.ts index 2cbe4d3..c4f7e98 100644 --- a/dist/transaction.d.ts +++ b/dist/transaction.d.ts @@ -1,18 +1,20 @@ -import { Addressable, BaseContract, ContractFactory, TransactionReceipt, TransactionRequest, TransactionResponse } from 'ethers'; +import { Addressable, BaseContract, ContractFactory, ContractTransaction, TransactionReceipt, TransactionRequest } from 'ethers'; export interface TransactionSigner extends Addressable { - estimateGas?: (tx: TransactionRequest) => Promise; - call?: (tx: TransactionRequest) => Promise; - resolveName?: (name: string) => Promise; - sendTransaction?: (tx: TransactionRequest) => Promise; + estimateGas: (tx: TransactionRequest) => Promise; + sendTransaction: (tx: TransactionRequest) => Promise; + call: (tx: TransactionRequest) => Promise; + resolveName: (name: string) => Promise; } export declare class Transaction { - readonly tx: TransactionResponse; + readonly data: ContractTransaction; + private readonly signer; private readonly waitCallback; - constructor(tx: TransactionResponse, waitCallback: (receipt: TransactionReceipt) => Promise); + constructor(data: ContractTransaction, signer: TransactionSigner, waitCallback: (receipt: TransactionReceipt) => Promise); wait(confirmations?: number): Promise; } export declare class Base { contract: C; + protected signer?: TransactionSigner; constructor(factory: ContractFactory, address: string, signer?: TransactionSigner); connect(signer: TransactionSigner): this; getChainId(): Promise; diff --git a/dist/transaction.js b/dist/transaction.js index 87fbd7b..e414e71 100644 --- a/dist/transaction.js +++ b/dist/transaction.js @@ -2,16 +2,19 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Base = exports.Transaction = void 0; class Transaction { - tx; + data; + signer; waitCallback; - constructor(tx, waitCallback) { - this.tx = tx; + constructor(data, signer, waitCallback) { + this.data = data; + this.signer = signer; this.waitCallback = waitCallback; } async wait(confirmations) { - const receipt = await this.tx.wait(confirmations); + const tx = await this.signer.sendTransaction(this.data); + const receipt = await tx.wait(confirmations); if (!receipt) { - throw new Error(`Unable to confirm: ${this.tx}`); + throw new Error(`Unable to confirm: ${tx}`); } return this.waitCallback(receipt); } @@ -19,10 +22,12 @@ class Transaction { exports.Transaction = Transaction; class Base { contract; + signer; constructor(factory, address, signer) { this.contract = factory.attach(address); if (signer) { this.connect(signer); + this.signer = signer; } } // Connects the API to a specific signer diff --git a/dist/transaction.js.map b/dist/transaction.js.map index e103fa4..99a1304 100644 --- a/dist/transaction.js.map +++ b/dist/transaction.js.map @@ -1 +1 @@ -{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":";;;AAkBA,MAAa,WAAW;IACN,EAAE,CAAsB;IACvB,YAAY,CAA8C;IAE3E,YAAY,EAAuB,EAAE,YAAyD;QAC5F,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,aAAsB;QACtC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAClD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACnD,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;C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