Skip to content

Commit

Permalink
Fix W5 subwallet id bits and code cell
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueCarry committed Dec 13, 2024
1 parent 8e72f43 commit e104620
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/components/WalletGenerator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,23 +172,22 @@ export function OpenedWalletInfo() {

function AddWalletPopup() {
const selectedKey = useSelectedKey()

// const typeRef = useRef<HTMLSelectElement>(null)
const subwalletIdRef = useRef<HTMLInputElement>(null)
const [walletType, setWalletType] = useState('v5R1')
const [walletAddress, setWalletAddress] = useState('')

const saveWallet = async (e: MouseEvent) => {
let saveWalletAddress: string | null = null
try {
const parsed = Address.parse(walletAddress)
saveWalletAddress = parsed.toString()
if (walletAddress) {
const parsed = Address.parse(walletAddress)
saveWalletAddress = parsed.toString()
}
} catch (err) {
if (walletType === 'multisig_v2_v4r2') {
e.preventDefault()
throw err
}
//
}
await CreateNewKeyWallet({
type: walletType as WalletType,
Expand Down
3 changes: 1 addition & 2 deletions src/contracts/w5/WalletV5R1.source.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Cell } from '@ton/core'

export const WalletV5R1CodeBoc =
'b5ee9c720101010100230008420220834b7b72b112147e1b2fb457b84e74d1a30f04f737d4f62a668e9552d2b72f'
// 'b5ee9c7201010101002300084202e4cf3b2f4c6d6a61ea0f2b5447d266785b26af3637db2deee6bcd1aa826f3412' beta
'b5ee9c7201021401000281000114ff00f4a413f4bcf2c80b01020120020302014804050102f20e02dcd020d749c120915b8f6320d70b1f2082106578746ebd21821073696e74bdb0925f03e082106578746eba8eb48020d72101d074d721fa4030fa44f828fa443058bd915be0ed44d0810141d721f4058307f40e6fa1319130e18040d721707fdb3ce03120d749810280b99130e070e2100f020120060702012008090019be5f0f6a2684080a0eb90fa02c02016e0a0b0201480c0d0019adce76a2684020eb90eb85ffc00019af1df6a2684010eb90eb858fc00017b325fb51341c75c875c2c7e00011b262fb513435c28020011e20d70b1f82107369676ebaf2e08a7f0f01e68ef0eda2edfb218308d722028308d723208020d721d31fd31fd31fed44d0d200d31f20d31fd3ffd70a000af90140ccf9109a28945f0adb31e1f2c087df02b35007b0f2d0845125baf2e0855036baf2e086f823bbf2d0882292f800de01a47fc8ca00cb1f01cf16c9ed542092f80fde70db3cd81003f6eda2edfb02f404216e926c218e4c0221d73930709421c700b38e2d01d72820761e436c20d749c008f2e09320d74ac002f2e09320d71d06c712c2005230b0f2d089d74cd7393001a4e86c128407bbf2e093d74ac000f2e093ed55e2d20001c000915be0ebd72c08142091709601d72c081c12e25210b1e30f20d74a111213009601fa4001fa44f828fa443058baf2e091ed44d0810141d718f405049d7fc8ca0040048307f453f2e08b8e14038307f45bf2e08c22d70a00216e01b3b0f2d090e2c85003cf1612f400c9ed54007230d72c08248e2d21f2e092d200ed44d0d2005113baf2d08f54503091319c01810140d721d70a00f2e08ee2c8ca0058cf16c9ed5493f2c08de20010935bdb31e1d74cd0'

export const WalletV5R1CodeCell = Cell.fromBoc(Buffer.from(WalletV5R1CodeBoc, 'hex'))[0]
2 changes: 1 addition & 1 deletion src/utils/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ function createBodyV5(keyPair: KeyPair, seqno: number, walletId: bigint, actions
const expireAt = Math.floor(Date.now() / 1000) + 60
const payload = beginCell()
.storeUint(Opcodes.auth_signed, 32)
.storeUint(walletId, 80)
.storeUint(walletId, 32)
.storeUint(expireAt, 32)
.storeUint(seqno, 32) // seqno
.storeSlice(actionsList.beginParse())
Expand Down

0 comments on commit e104620

Please sign in to comment.