Skip to content

Commit ab66a47

Browse files
committed
sdk: get/setPauser
1 parent b35a162 commit ab66a47

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

evm/ts/src/ntt.ts

+4
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ export class EvmNtt<N extends Network, C extends EvmChains>
201201
return new EvmAddress(await this.manager.owner()) as AccountAddress<C>;
202202
}
203203

204+
async getPauser(): Promise<AccountAddress<C> | null> {
205+
return new EvmAddress(await this.manager.pauser()) as AccountAddress<C>;
206+
}
207+
204208
async *setOwner(owner: AccountAddress<C>) {
205209
const canonicalOwner = canonicalAddress({chain: this.chain, address: owner});
206210
const tx = await this.manager.transferOwnership.populateTransaction(canonicalOwner);

sdk/definitions/src/ntt.ts

+4
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,12 @@ export interface Ntt<N extends Network, C extends Chain> {
173173

174174
getOwner(): Promise<AccountAddress<C>>;
175175

176+
getPauser(): Promise<AccountAddress<C> | null>;
177+
176178
setOwner(newOwner: AccountAddress<C>, payer?: AccountAddress<C>): AsyncGenerator<UnsignedTransaction<N, C>>;
177179

180+
setPauser(newOwner: AccountAddress<C>, payer?: AccountAddress<C>): AsyncGenerator<UnsignedTransaction<N, C>>;
181+
178182
getThreshold(): Promise<number>;
179183

180184
setPeer(

solana/ts/sdk/ntt.ts

+8
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ export class SolanaNtt<N extends Network, C extends SolanaChains>
189189
return new SolanaAddress(config.owner) as AccountAddress<C>;
190190
}
191191

192+
async getPauser(): Promise<AccountAddress<C> | null> {
193+
return null
194+
}
195+
192196
async *setOwner(newOwner: AccountAddress<C>, payer: AccountAddress<C>) {
193197
const sender = new SolanaAddress(payer).unwrap();
194198
const ix = await NTT.createTransferOwnershipInstruction(this.program, {
@@ -201,6 +205,10 @@ export class SolanaNtt<N extends Network, C extends SolanaChains>
201205
yield this.createUnsignedTx({ transaction: tx }, "Ntt.SetOwner");
202206
}
203207

208+
async *setPauser(_newPauser: AccountAddress<C>, _payer: AccountAddress<C>) {
209+
throw new Error("Pauser role not supported on Solna.");
210+
}
211+
204212
async isRelayingAvailable(destination: Chain): Promise<boolean> {
205213
if (!this.quoter) return false;
206214
return await this.quoter.isRelayEnabled(destination);

0 commit comments

Comments
 (0)