Skip to content

Commit ab6b2cb

Browse files
Merge pull request #7129 from BitGo/WIN-7258_sol_token_tranfer_hook-1
feat(sdk-coin-sol): token 2022 transfer hook implementation
2 parents 270f5e8 + 9a7ab29 commit ab6b2cb

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

modules/sdk-coin-sol/src/config/token2022StaticConfig.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,21 @@ export const TOKEN_2022_STATIC_CONFIGS: Token2022Config[] = [
1212
authority: 'CPNEkz5SaAcWqGMezXTti39ekErzMpDCtuPMGw9tt4CZ',
1313
extraAccountMetas: [
1414
{
15-
pubkey: '4zDeEh2D6K39H8Zzn99CpQkaUApbpUWfbCgqbwgZ2Yf',
15+
pubkey: '98wFF5MpMjMQbfDF2MPzo8LCGX37unZR1ohRA1mU9GmJ',
1616
isSigner: false,
1717
isWritable: true,
1818
},
19+
{
20+
pubkey: '48n7YGEww7fKMfJ5gJ3sQC3rM6RWGjpUsghqVfXVkR5A',
21+
isSigner: false,
22+
isWritable: false,
23+
},
24+
{
25+
pubkey: '9sQhAH7vV3RKTCK13VY4EiNjs3qBq1srSYxdNufdAAXm',
26+
isSigner: false,
27+
isWritable: false,
28+
},
1929
],
20-
extraAccountMetasPDA: '9sQhAH7vV3RKTCK13VY4EiNjs3qBq1srSYxdNufdAAXm',
2130
},
2231
},
2332
{
@@ -31,12 +40,21 @@ export const TOKEN_2022_STATIC_CONFIGS: Token2022Config[] = [
3140
authority: 'BLZvvaQgPUvL2RWoJeovudbHMhqH4S3kdenN5eg1juDr',
3241
extraAccountMetas: [
3342
{
34-
pubkey: '4zDeEh2D6K39H8Zzn99CpQkaUApbpUWfbCgqbwgZ2Yf',
43+
pubkey: 'GbQ8ZiEFzGGTeYoXwtZtcoxwPcMyUcmZDduMVNdUPKpX',
3544
isSigner: false,
3645
isWritable: true,
3746
},
47+
{
48+
pubkey: '2Te6MFDwstRP2sZi6DLbkhVcSfaQVffmpbudN6pmvAXo',
49+
isSigner: false,
50+
isWritable: false,
51+
},
52+
{
53+
pubkey: 'FR5YBEisx8mDe4ruhWKmpH5nirdJopj4uStBAVufqjMo',
54+
isSigner: false,
55+
isWritable: false,
56+
},
3857
],
39-
extraAccountMetasPDA: 'FR5YBEisx8mDe4ruhWKmpH5nirdJopj4uStBAVufqjMo',
4058
},
4159
},
4260
];

modules/sdk-coin-sol/src/lib/solInstructionFactory.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -719,13 +719,6 @@ function buildStaticTransferHookAccounts(transferHook: TransferHookConfig): Acco
719719
});
720720
}
721721
}
722-
metas.push({ pubkey: new PublicKey(transferHook.authority), isSigner: false, isWritable: false });
723-
metas.push({ pubkey: new PublicKey(transferHook.programId), isSigner: false, isWritable: false });
724-
725-
if (transferHook.extraAccountMetasPDA) {
726-
metas.push({ pubkey: new PublicKey(transferHook.extraAccountMetasPDA), isSigner: false, isWritable: false });
727-
}
728-
729722
return metas;
730723
}
731724

modules/sdk-coin-sol/test/unit/solInstructionFactory.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,17 +202,7 @@ describe('Instruction Builder Tests: ', function () {
202202
isSigner: meta.isSigner,
203203
isWritable: meta.isWritable,
204204
})),
205-
{ pubkey: new PublicKey(transferHook.authority), isSigner: false, isWritable: false },
206-
{ pubkey: new PublicKey(transferHook.programId), isSigner: false, isWritable: false },
207205
];
208-
209-
if (transferHook.extraAccountMetasPDA) {
210-
expectedExtraKeys.push({
211-
pubkey: new PublicKey(transferHook.extraAccountMetasPDA),
212-
isSigner: false,
213-
isWritable: false,
214-
});
215-
}
216206
extraKeys.should.deepEqual(expectedExtraKeys);
217207

218208
for (const expectedMeta of expectedExtraKeys) {

0 commit comments

Comments
 (0)