diff --git a/examples/availability/publish_hosted/PublishHosted.java b/examples/availability/publish_hosted/PublishHosted.java index bee16e73..d2948f66 100644 --- a/examples/availability/publish_hosted/PublishHosted.java +++ b/examples/availability/publish_hosted/PublishHosted.java @@ -2,6 +2,7 @@ import com.bloock.sdk.client.AvailabilityClient; import com.bloock.sdk.client.RecordClient; import com.bloock.sdk.entity.availability.HostedPublisher; +import com.bloock.sdk.entity.availability.PublishResponse; import com.bloock.sdk.entity.record.Record; public class PublishHosted { @@ -14,7 +15,9 @@ public static void main(String[] args) throws Exception { Record record = recordClient.fromString("Hello world").build(); - String id = availabilityClient.publish(record, new HostedPublisher()); // it returns the hash + PublishResponse response = availabilityClient.publish(record, new HostedPublisher()); + String id = response.getID(); + } catch (Exception e) { System.out.println(e); } diff --git a/examples/availability/publish_ipfs/PublishIpfs.java b/examples/availability/publish_ipfs/PublishIpfs.java index cd76d546..d33b00a1 100644 --- a/examples/availability/publish_ipfs/PublishIpfs.java +++ b/examples/availability/publish_ipfs/PublishIpfs.java @@ -2,6 +2,7 @@ import com.bloock.sdk.client.AvailabilityClient; import com.bloock.sdk.client.RecordClient; import com.bloock.sdk.entity.availability.IpfsPublisher; +import com.bloock.sdk.entity.availability.PublishResponse; import com.bloock.sdk.entity.record.Record; public class PublishIpfs { @@ -14,8 +15,9 @@ public static void main(String[] args) throws Exception { Record record = recordClient .fromString("Hello world") .build(); - - String id = availabilityClient.publish(record, new IpfsPublisher()); + + PublishResponse response = availabilityClient.publish(record, new IpfsPublisher()); + String id = response.getID(); System.out.println("Record was published successfully"); } diff --git a/examples/config.yml b/examples/config.yml index 8fc50f92..211c19d8 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -16,7 +16,7 @@ runners: cmd: yarn eslint -c /var/runners/typescript/eslint.config.js {{ snippet.dir }}/**/*.{ts,tsx} run: before: timeout 600 ash -c 'until stat /tmp/runner_is_ready; do sleep 1; done' - cmd: yarn tsc {{ snippet.dir }}/{{ snippet.source }} --noEmit --module es2022 --target es2022 --moduleResolution Node --esModuleInterop + cmd: yarn tsc {{ snippet.dir }}/{{ snippet.source }} --noEmit --module es2022 --target es2022 --moduleResolution Node --esModuleInterop --skipLibCheck golang: service: doc-runner-golang diff --git a/examples/key/load_local_certificate/load_local_certificate.ts b/examples/key/load_local_certificate/load_local_certificate.ts index a61b72ad..5c9a0cc3 100644 --- a/examples/key/load_local_certificate/load_local_certificate.ts +++ b/examples/key/load_local_certificate/load_local_certificate.ts @@ -8,4 +8,6 @@ const keyClient = new KeyClient(); const dirPath = path.join(__dirname, '/certificate.p12'); const buffer = fs.readFileSync(dirPath); -const _certificate = await keyClient.loadLocalCertificate(buffer, 'password'); +const uint8 = new Uint8Array(buffer); + +const _certificate = await keyClient.loadLocalCertificate(uint8, 'password'); diff --git a/examples/record/prepare_record/prepare_record.ts b/examples/record/prepare_record/prepare_record.ts index 3c7c3f5a..040b9754 100644 --- a/examples/record/prepare_record/prepare_record.ts +++ b/examples/record/prepare_record/prepare_record.ts @@ -14,7 +14,9 @@ try { // we can read a file as an array of bytes const file = fs.readFileSync('sample.pdf'); - const _record3 = await recordClient.fromFile(file).build(); + const uint8 = new Uint8Array(file); + + const _record3 = await recordClient.fromFile(uint8).build(); } catch (e) { console.log(e); }