Skip to content

Commit

Permalink
try to fix Martian/Rise Invalid vector args (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yolley authored Nov 9, 2023
1 parent b56d9fc commit eea3fb5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"packages": [
"packages/*"
],
"version": "5.6.1",
"version": "5.6.2",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions packages/stream/aptos/StreamClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,19 @@ export default class AptosStreamClient extends BaseStreamClient {
return multipleStreamData.recipients.map((recipient) => {
const acc = new AptosAccount(); // Generate random address as seeds for deriving "escrow" account
const seeds = acc.address();
const metadataId = AptosAccount.getResourceAccountAddress(
wallet.address,
seeds.toUint8Array()
);
const encoder = new TextEncoder();
// A workaround to pass a String in seeds because different wallets seem
// to serialize vector<u8> differently and String should be safer that Uin8Array
const actualSeeds = encoder.encode(seeds.hex());
const metadataId = AptosAccount.getResourceAccountAddress(wallet.address, actualSeeds);
return [
metadataId.toString(),
{
type: "create",
function: `${this.programId}::protocol::create`,
type_arguments: [multipleStreamData.tokenId],
arguments: [
seeds.toUint8Array(),
seeds.hex(),
recipient.amount.toString(),
multipleStreamData.period,
recipient.amountPerPeriod.toString(),
Expand Down
2 changes: 1 addition & 1 deletion packages/stream/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/stream",
"version": "5.6.1",
"version": "5.6.2",
"description": "JavaScript SDK to interact with Streamflow protocol.",
"main": "dist/index.js",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
Expand Down

0 comments on commit eea3fb5

Please sign in to comment.