Skip to content

Commit eea3fb5

Browse files
authored
try to fix Martian/Rise Invalid vector args (#105)
1 parent b56d9fc commit eea3fb5

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"packages": [
33
"packages/*"
44
],
5-
"version": "5.6.1",
5+
"version": "5.6.2",
66
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
77
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/stream/aptos/StreamClient.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,19 @@ export default class AptosStreamClient extends BaseStreamClient {
260260
return multipleStreamData.recipients.map((recipient) => {
261261
const acc = new AptosAccount(); // Generate random address as seeds for deriving "escrow" account
262262
const seeds = acc.address();
263-
const metadataId = AptosAccount.getResourceAccountAddress(
264-
wallet.address,
265-
seeds.toUint8Array()
266-
);
263+
const encoder = new TextEncoder();
264+
// A workaround to pass a String in seeds because different wallets seem
265+
// to serialize vector<u8> differently and String should be safer that Uin8Array
266+
const actualSeeds = encoder.encode(seeds.hex());
267+
const metadataId = AptosAccount.getResourceAccountAddress(wallet.address, actualSeeds);
267268
return [
268269
metadataId.toString(),
269270
{
270271
type: "create",
271272
function: `${this.programId}::protocol::create`,
272273
type_arguments: [multipleStreamData.tokenId],
273274
arguments: [
274-
seeds.toUint8Array(),
275+
seeds.hex(),
275276
recipient.amount.toString(),
276277
multipleStreamData.period,
277278
recipient.amountPerPeriod.toString(),

packages/stream/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@streamflow/stream",
3-
"version": "5.6.1",
3+
"version": "5.6.2",
44
"description": "JavaScript SDK to interact with Streamflow protocol.",
55
"main": "dist/index.js",
66
"homepage": "https://github.com/streamflow-finance/js-sdk/",

0 commit comments

Comments
 (0)