Skip to content

feat: support to WalletV5R1 #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nowooj
Copy link

@nowooj nowooj commented Mar 5, 2025

Features

  • WalletV5R1

PS

It's need to a solution for loadTlb in WalletData, but it is not a necessary value if WalletContract has a Wallet ID.
Currently, It works fine.

Closed #123

val storeWalletId = cellSlice.loadInt(32)
val publicKey = PublicKeyEd25519(ByteString(*cellSlice.loadBits(256).toByteArray()))

// TODO wallet ID parsing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we introduce a new entity, then we should not have a "todo" for it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cellBuilder.storeUInt(value.seqno, 32)
cellBuilder.storeInt(value.walletId.serialize(), 32)
cellBuilder.storeBytes(value.publicKey.key.toByteArray())
cellBuilder.storeBoolean(false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we dont parse it in loadTlb?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was because of concerns about workchain, walletVersion, and subwalletNumber of WalletID.
We cannot use the xor operation in serialize and load the corresponding values. For now, I applied them as default values. But I'm not sure if this is a good way to do it.
56506f2

*transfers
)

val body = Either.of<Cell, CellRef<Cell>>(null, CellRef(value = transferBody, AnyTlbConstructor))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Permanently set to cell? There should be a way to change this, there is a MessageLayout class for this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

): Cell {
val packed = packV5Actions(*gifts)
val unsignedBody = CellBuilder.createCell {
storeUInt(0x7369676E, 32) // MessageType.ext
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magic constant

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end of file without space

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andreypfau
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TON W5
2 participants